gisinternals / buildsystem

Build system on www.gisinternals.com
MIT License
33 stars 10 forks source link

GDAL 3.0.4 PROJ6 Coordinate Transform Issues #158

Closed tredpath closed 1 year ago

tredpath commented 4 years ago

I'm getting errors when trying to do coordinate transforms with the latest GDAL/PROJ combination. I noticed the issue first with OCTTransform in C++ but I've tested it on the command line using gdaltransform as well. The projections I'm testing are in this gist.

GDAL transform with GDAL 3.0.4 and the PROJ_LIB environment variable pointing to the PROJ6 share folder gives the following for a test point of (474988.55447249539, 5720406.0446121963).

> gdaltransform.exe -s_srs test_s_srs.prj -t_srs test_t_srs.prj
474988.55447249539 5720406.0446121963
ERROR 1: Cannot find transformation for provided coordinates
transformation failed.

If I unset PROJ_LIB I get the expected error saying the proj data doesn't exist but the coordinate transform does succeed.

> gdaltransform.exe -s_srs test_s_srs.prj -t_srs test_t_srs.prj
ERROR 1: PROJ: proj_get_authorities_from_database: Cannot find proj.db
ERROR 1: PROJ: proj_get_authorities_from_database: Cannot find proj.db
ERROR 1: PROJ: proj_get_authorities_from_database: Cannot find proj.db
ERROR 1: PROJ: proj_get_authorities_from_database: Cannot find proj.db
ERROR 1: PROJ: proj_create_from_database: Cannot find proj.db
474988.55447249539 5720406.0446121963
-115.3617 51.6547000000149 0

Using the distribution of GDAL 3.0.4 that is included with Ubuntu 20.04 the transform works as expected so I don't think it's an issue with my projection.

> gdaltransform -s_srs test_s_srs.prj -t_srs test_t_srs.prj
474988.55447249539 5720406.0446121963
-115.3617 51.6547000000149 0
jratike80 commented 2 years ago

The issue may still be valid for archived GDAL 3.0.4 version but because the test command works OK at least with GDAL 3.6.0dev version that I tested I think that this issue could be closed.