-
Notifications
You must be signed in to change notification settings - Fork 790
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
multi-grid GTG with overlapping grids and nodata #4197
Comments
Please provide elements on how to exactly reproduce the issue |
Sorry for the delay. In trying to reproduce the issue I found that our initial tests were likely using the first grid in a multi-grid GTG Tiff. When I tried the data in the other ticket proj returned INF in anything other than the first grids. It seems that this is a Proj question of if our files are correct and should be supported. @rouault do you agree it shoud be a ticket at proj? Maybe you know this shouldn't work before I make more spam over there (like should we use NTv2 instead etc). And, of course, many thanks for all your time and efforts on both projects.
single grid transform "non-gtg" Same location using the multi-grid file (this happens to be in the fifth grid)
Pick a location for the first grid in the file instead
|
@barry-gallagher The issue is that the point -76.37 38.08 falls into several partially-overlapping grids. The current logic in PROJ is that, in that situation, it uses the first grid whose extent contains the point, independently if the grid value is nodata or not. And here the first grid that contains the point is at nodata
|
Looking at the GGXF spec at |
Thanks for the quick response. Is there a different multi-grid format that has the behavior of checking multiple grids on nodata (perhaps NTv2)? We had read that same 5.7 section and my recollection was that nodata would check further grids. Admittedly this was a while ago I read it on a flight with a coworker. I will check with my colleague who created the files and see if it was a different spec that applied to or if we are just mistaken. |
no, the NTv2 reader should behave the same, and NTv2 is only for horizontal adjustment grids, not vertical ones.
could be worth filing that as a question to https://github.com/opengeospatial/CRS-Gridded-Geodetic-data-eXchange-Format to see how they envision that issue, so we have possibly a common solution for that use case (although checking for pixel values when deciding the candidate sub-grid might have performance implications or implementation complication). Generally speaking nodata values in geodetic grids are a bit of a pain (especially for horizontal adjument grids, in the reverse direction). Most data producers extend the fields to avoid data holes. |
What is the bug?
When trying to use our proj.db and transformation grids we get all zeros or a no-op for our GTG TIFFs. It could be related to OSGeo/gdal#10395 but we don't get the vertical shift where the non-gtg tiffs give a vertical shift. Perhaps the first sub-tiff has a nodata value in the location we are querying and a zero is reported rather than inspecting the next sub-tiff. Proj.transform does return the correct transform value but gdalwarp does not.
Steps to reproduce the issue
We can supply our proj.db and tiffs if needed
Versions and provenance
Windows 10/11, gdal 3.8.4, python 3.11
Additional context
No response
The text was updated successfully, but these errors were encountered: