OSGeo / PROJ-data

Repository for proj datum grids (for use by PROJ 7 or later)
Other
73 stars 34 forks source link

check_gtiff_grid.py: add support for checking TYPE=DEFORMATION_MODEL #19

Closed rouault closed 4 years ago

rouault commented 4 years ago

CC @ccrook I've run it on the grids of https://github.com/rouault/PROJ/files/4520328/nzgd2000-defmodel.zip and it raises several issues, for example (but similar patterns in all files):

/home/even/proj/deformation_model/build_autoconf/nzgd2000-c120100904-grid01.tif is NOT a valid PROJ GeoTIFF file.
The following errors were found (corrective action is required):
 - IFD 1: Extent (171.100000,-42.812500,173.275000,-44.343750) of grid patch_c1_20100904_grid_c1_L2 is not inside its parent patch_c1_20100904_grid_c1_L1 extent (168.100000,-40.375000,176.200000,-46.750000)
 - IFD 2: Extent (171.625000,-43.250000,172.721875,-43.898438) of grid patch_c1_20100904_grid_c1_L3 is not inside its parent patch_c1_20100904_grid_c1_L2 extent (171.100000,-42.812500,173.275000,-44.343750)
 - IFD 3: Extent (171.812500,-43.423828,172.527344,-43.697266) of grid patch_c1_20100904_grid_c1_L4 is not inside its parent patch_c1_20100904_grid_c1_L3 extent (171.625000,-43.250000,172.721875,-43.898438)

The following warnings were found (the file will probably be read correctly by PROJ, but corrective action may be required):
 - IFD 0: Geotransform with a positive pixel height, that is a south-up image, is supported, but a unusual formulation
 - IFD 0: GDAL area_of_use metadata item is missing. Typically used to capture plain text information about where the grid applies
 - IFD 1: Geotransform with a positive pixel height, that is a south-up image, is supported, but a unusual formulation
 - IFD 2: Geotransform with a positive pixel height, that is a south-up image, is supported, but a unusual formulation
 - IFD 3: Geotransform with a positive pixel height, that is a south-up image, is supported, but a unusual formulation

The errors should be addressed. Basically it detects inconsistencies between the parent/child relationships given with the grid_name metadata item, and their respective bounding box. The warnings are OK

ccrook commented 4 years ago

Hi @rouault

The attached files fix the order of rows in the deformation model gruds to be south to north. The issue with parent/child relationship is a byproduct of this - I haven't looked but I suspect check_tiff_grid isn't accounting for this properly when it compares extents. The revised grids give no errors from check_gtiff_grid and also still pass the nzgd2000-20180701.gie tests.

nzgd2000-defmod-20180701.zip

rouault commented 4 years ago

I haven't looked but I suspect check_tiff_grid isn't accounting for this properly when it compares extents

Ah you're right. I've just fixed this per commit 36af62233c9e03e9a064d2f0f68e957f1a979de9