Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference in output between node-gdal and gdaltransform #244

Open
magnet47 opened this issue Aug 31, 2018 · 4 comments
Open

Difference in output between node-gdal and gdaltransform #244

magnet47 opened this issue Aug 31, 2018 · 4 comments

Comments

@magnet47
Copy link

I was reprojecting some points and noticed the output is off about 100 ft compared to gdaltransform.
Tested using Node 8.11 and 10.9.

var gdal = require('gdal')

var source = new gdal.SpatialReference.fromEPSG(32028)
var dest = new gdal.SpatialReference.fromEPSG(4326)

var transform = new gdal.CoordinateTransformation(source, dest)

console.log(transform.transformPoint(2397350, 386280))
// console output { x: -76.30565504809337, y: 41.21778496363833, z: 0 }
// EPSG.io output -76.3053142, 41.217868
// gdaltransform -s_srs EPSG:32028 -t_srs EPSG:4326
// 2397350 386280
// -76.3053143354412 41.2178680673729 0
@brianreavis
Copy link
Member

What versions of GDAL/PROJ are you running?

$ gdalinfo --version
# GDAL 2.3.1, released 2018/06/22
$ proj
# Rel. 5.1.0, June 1st, 2018

@magnet47
Copy link
Author

gdalinfo --version
GDAL 2.2.4, released 2018/03/19
proj
Rel. 4.9.3, 15 August 2016

@sbmelvin
Copy link

sbmelvin commented Sep 6, 2018

I think the bundled version of GDAL is the root of the problem. If I configure node-gdal to use my local install of gdal (npm install gdal --build-from-source --shared_gdal), the result matches what I get from gdaltransform.

Source x y
bundled gdal -76.30565504809337 41.21778496363833
shared gdal -76.30531433544122 41.21786806737292
gdaltransform -76.3053143354412 41.2178680673729

$ proj
Rel. 5.1.0, June 1st, 2018

gdalinfo --version
GDAL 2.3.1, released 2018/06/22

@magnet47
Copy link
Author

magnet47 commented Sep 6, 2018

I agree, trying the same test with Ubuntu 17.04 and linking against shared libgdal produced the correct output for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants