-
Notifications
You must be signed in to change notification settings - Fork 748
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
Add API to determine which grid files were actually used during a transformation #3176
Comments
This can be achieved with the PROJ_DEBUG environment variable. |
Adding all of PROJ's debug logging to our application's output isn't really what we're looking for. It also doesn't directly connect the grid that was requested in the transformation to the one that was eventually used, it just shows the files PROJ tried to access without any other context. Additionally it causes PROJ to print it's attempted access to every file that it uses, including |
These are likely helpful: Lines 1475 to 1487 in c0e2a9a
|
That gets a little closer to what we're looking for, but unfortunately it stops short of actually telling us which grid was used by a transformation. It mostly just lists information about where the grid could be found. It also has some slightly odd behaviour. The Regardless even if we could deduce what grid was used from this information (not possible due to the weird behaviour when networking is enabled), I wouldn't want to rely on current knowledge of PROJ's internal behaviour when choosing grids to decide which was the right grid to report to our users, since PROJ's behaviour could change without any obvious external effect. |
…networking is enabled (fixes OSGeo#3176)
@DalePAtSafe #3180 should give you what you need |
Thanks Even! Looking forward to testing it out. |
…networking is enabled (fixes OSGeo#3176)
Make it possible to determine which grid files were actually used during a transformation (fixes #3176)
As a PROJ user integrating the library into my company’s software I would like to be able to inform my users when a requested grid file in a transformation has resolved to a different file.
For example, currently if the file NTv2_0.gsb in the PROJ search path, but the transformation specified uses ca_nrc_ntv2_0.tif, PROJ will silently use NTv2_0.gsb with no simple way of discovering it has done so. I would like to be able to query the transformation object for the required grids and also what they were resolved to.
Something like the following (API just given as an example of what we’re looking for, it doesn’t need to be exactly this):
Added to proj.h
Example Usage:
Which for my example would print:
Requested grid ca_nrc_ntv2_0.tif resolved to /path/to/NTv2_0.gsb
If networking were enabled and there was no matching grid locally it would print the CDN URL that was used:
Requested grid ca_nrc_ntv2_0.tif resolved to https://cdn.proj.org/ca_nrc_ntv2_0.tif
And of course if it was not found then it would print:
Requested grid ca_nrc_ntv2_0.tif not found
This was motivated by one of our developers trying to put together an example of a transformation that needed networking, and was surprised to discover that the transformation worked even without networking by using a completely different (though equivalent) grid file.
The text was updated successfully, but these errors were encountered: