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

Inconsistent transformations of coords between OSX and ubuntu #3773

Closed
gmmorris opened this issue Jun 23, 2023 · 2 comments
Closed

Inconsistent transformations of coords between OSX and ubuntu #3773

gmmorris opened this issue Jun 23, 2023 · 2 comments

Comments

@gmmorris
Copy link

I'm not sure if this is a PROJ issue, or a georust issue, so cross-posting.

Example of problem

The code is identical in both cases, it's the result of the calculation that changes between OSX and ubuntu.
I'm using the convert API ion the Rust library - not sure what it maps to in the C library, sorry.

https://github.com/georust/proj/blob/aafff341ce6fccf887e0f9011dfbd55c069af761/src/proj.rs#L803

Problem description

I'm transforming geometries received in EPSG::27700 to OGC:1.3:CRS84.

I'm encountering some inconsistencies between my local environment (OSX) and my CI (ubuntu-latest on Github Actions).

Given this geometry:

{ "type": "Point", "coordinates": [492941.3929127551,144592.2391630347] }

Locally on OSX and transform these coords are transformed into:

{ "type": "Point", "coordinates": [-0.6713249654966993, 51.19300053717864] }

But then on CI they are transformed into:

{ "type": "Point", "coordinates": [-0.6713438264761399, 51.193003894930584] }

Any thoughts on why this inconsistency might be happening and how I can avoid it?

I'm happy to compromise on resolution (cm would be ideal, but meter could work if that helps), but mostly I want to understand if this is a rounding or configuration issue.

Cheers

@gmmorris gmmorris added the bug label Jun 23, 2023
@rouault rouault removed the bug label Jun 23, 2023
@rouault
Copy link
Member

rouault commented Jun 23, 2023

The results depend if you have the uk_os_OSTN15_NTv2_OSGBtoETRS.tif available. The results on OSX are with the grids, the results on your CI are without it (less accurate)

cf

$ echo 492941.3929127551 144592.2391630347 | PROJ_DEBUG=2 PROJ_NETWORK=ON bin/cs2cs -d 10 EPSG:27700 EPSG:4326
pj_open_lib(proj.ini): call fopen(/home/even/proj/install-proj-master/share/proj/proj.ini) - succeeded
pj_open_lib(proj.db): call fopen(/home/even/proj/install-proj-master/share/proj/proj.db) - succeeded
pj_open_lib(uk_os_OSTN15_NTv2_OSGBtoETRS.tif): call fopen(uk_os_OSTN15_NTv2_OSGBtoETRS.tif) - failed
pj_open_lib(OSTN15_NTv2_OSGBtoETRS.gsb): call fopen(OSTN15_NTv2_OSGBtoETRS.gsb) - failed
pj_open_lib(uk_os_OSTN15_NTv2_OSGBtoETRS.tif): call fopen(uk_os_OSTN15_NTv2_OSGBtoETRS.tif) - failed
pj_open_lib(OSTN15_NTv2_OSGBtoETRS.gsb): call fopen(OSTN15_NTv2_OSGBtoETRS.gsb) - failed
Using https://cdn.proj.org/uk_os_OSTN15_NTv2_OSGBtoETRS.tif
Using coordinate operation Inverse of British National Grid + OSGB36 to WGS 84 (9)
pj_open_lib(uk_os_OSTN15_NTv2_OSGBtoETRS.tif): call fopen(uk_os_OSTN15_NTv2_OSGBtoETRS.tif) - failed
pj_open_lib(OSTN15_NTv2_OSGBtoETRS.gsb): call fopen(OSTN15_NTv2_OSGBtoETRS.gsb) - failed
Using https://cdn.proj.org/uk_os_OSTN15_NTv2_OSGBtoETRS.tif
51.1930005372	-0.6713249655 0.0000000000

vs

$ echo 492941.3929127551 144592.2391630347 | PROJ_DEBUG=2 bin/cs2cs -d 10 EPSG:27700 EPSG:4326
pj_open_lib(proj.ini): call fopen(/home/even/proj/install-proj-master/share/proj/proj.ini) - succeeded
pj_open_lib(proj.db): call fopen(/home/even/proj/install-proj-master/share/proj/proj.db) - succeeded
pj_open_lib(uk_os_OSTN15_NTv2_OSGBtoETRS.tif): call fopen(uk_os_OSTN15_NTv2_OSGBtoETRS.tif) - failed
pj_open_lib(OSTN15_NTv2_OSGBtoETRS.gsb): call fopen(OSTN15_NTv2_OSGBtoETRS.gsb) - failed
pj_open_lib(uk_os_OSTN15_NTv2_OSGBtoETRS.tif): call fopen(uk_os_OSTN15_NTv2_OSGBtoETRS.tif) - failed
pj_open_lib(OSTN15_NTv2_OSGBtoETRS.gsb): call fopen(OSTN15_NTv2_OSGBtoETRS.gsb) - failed
Using coordinate operation Inverse of British National Grid + OSGB36 to WGS 84 (9)
Attempt to use coordinate operation Inverse of British National Grid + OSGB36 to WGS 84 (9) failed. Grid uk_os_OSTN15_NTv2_OSGBtoETRS.tif is not available. Consult https://proj.org/resource_files.html for guidance. This might become an error in a future PROJ major release. Set the ONLY_BEST option to YES or NO. This warning will no longer be emitted (for the current transformation instance).
No inverse operation
Did not result in valid result. Attempting a retry with another operation.
Using coordinate operation Inverse of British National Grid + OSGB36 to WGS 84 (6)
51.1930038949	-0.6713438265 0.0000000000

Cf https://proj.org/en/9.2/resource_files.html and https://proj.org/en/9.2/usage/network.html

@rouault rouault closed this as completed Jun 23, 2023
@gmmorris
Copy link
Author

amazing, thanks for the quick response!

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

2 participants