aboutsummaryrefslogtreecommitdiff
path: root/test/gie/geotiff_grids.gie
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-22 18:31:26 +0100
committerGitHub <noreply@github.com>2020-01-22 18:31:26 +0100
commitdb31b6dfa9c8fe37d5706d95ce81012b8db3c3b9 (patch)
treedc592c2b56f8af476c42a51f5dbc6ee04fabc280 /test/gie/geotiff_grids.gie
parent1ad703a58ce1867fe2ede96ebced1bdec9c63d65 (diff)
downloadPROJ-db31b6dfa9c8fe37d5706d95ce81012b8db3c3b9.tar.gz
PROJ-db31b6dfa9c8fe37d5706d95ce81012b8db3c3b9.zip
Merge RFC4 (#1865)
This commit is the result of the squashing of rfc4_dev branch in a single commit. It implements mostly RFC 4 related work. * Grid handling: - remove obsolete and presumably unfinished implementation of grid catalog functionality - all grid functionality is in grids.cpp/.hpp - vertical and horizontal grid shift: rework to no longer load whole grid into memory - remove hgrids and vgrids member from PJ structure, and store them in hgridshift/vgridshift/deformation structures - build systems: add optional libtiff dependency. Must be explicitly disabled if not desired - add support for horizontal and vertical grids in GeoTIFF, if libtiff is available - add GenericShiftGridSet and GenericShiftGrid classes, relying on TIFF grids, that can be used for generic purpose grid-based adjustment - add a +proj=xyzgridshift method to perform geocentric translation by grid. Used for French NTF to RGF93 transformation using gr3df97a.tif grid - deformation: add support for +grids= for GeoTIFF grids - horizontal grid shift: fix failures on points slightly outside a subgrid (fixes #209) * File management: - add a filemanager.cpp/.hpp to deal with file related work - test for legacy proj_api.h fileapi - proj.h: add proj_context_set_fileapi() and proj_context_set_sqlite3_vfs_name() (fixes #866) - add capability to read resource files from the user writable directory * Network access: - build systems: add optional curl dependency - add a curl-based default implementation for network related functionality - proj.h: add C API to control network functionality, and optionaly provide network callbacks - add data/proj.ini with default settings - add a SQLite3 local cache of downloaded chunks - add proj_is_download_needed() and proj_download_file() * Use Win32 Unicode APIs and expect all strings to be UTF-8 (fixes #1765) For backward compatibility, if PROJ_LIB content is found to be not UTF-8 or pointing to a non existing directory, then an attempt at interpretating it in the ANSI page encoding is done. proj_context_set_search_paths() now assumes strings to be in UTF-8, and functions returning paths will also return values in UTF-8.
Diffstat (limited to 'test/gie/geotiff_grids.gie')
-rw-r--r--test/gie/geotiff_grids.gie324
1 files changed, 324 insertions, 0 deletions
diff --git a/test/gie/geotiff_grids.gie b/test/gie/geotiff_grids.gie
new file mode 100644
index 00000000..62a5b16d
--- /dev/null
+++ b/test/gie/geotiff_grids.gie
@@ -0,0 +1,324 @@
+
+-------------------------------------------------------------------------------
+===============================================================================
+Test GeoTIFF grids
+===============================================================================
+
+<gie>
+
+# Those first tests using +proj=vgridshift only test the capability of reading
+# correctly a value from various formulations of GeoTIFF file, hence only the
+# forward path is tested (reverse path is tested in other files)
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_pixelispoint.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_pixelisarea.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_deflate.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_deflate_floatingpointpredictor.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_uint16.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_uint16_with_scale_offset.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_int16.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_int32.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_uint32.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_float64.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+# The overview should be ignored
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_with_overview.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_in_second_channel.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_bigtiff.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_bigendian.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_bigendian_bigtiff.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_bottomup_with_scale.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_bottomup_with_matrix.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_with_subgrid.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.5 52.5 0
+expect 4.5 52.5 11.5
+
+# In subgrid
+accept 5.5 53.5 0
+expect 5.5 53.5 110.0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_nodata.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept 4.05 52.1 0
+expect 4.05 52.1 10
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_invalid_channel_type.tif +multiplier=1
+-------------------------------------------------------------------------------
+expect failure errno failed_to_load_grid
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_vgrid_unsupported_byte.tif +multiplier=1
+-------------------------------------------------------------------------------
+expect failure errno failed_to_load_grid
+-------------------------------------------------------------------------------
+
+
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_separate.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_strip.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_tiled.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_tiled_separate.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_positive_west.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_lon_shift_first.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_radian.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_degree.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+# The overview should be ignored
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_with_overview.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_extra_ifd_with_other_info.tif
+-------------------------------------------------------------------------------
+tolerance 2 mm
+accept 4.5 52.5 0
+expect 5.875 55.375 0
+-------------------------------------------------------------------------------
+
+# Subset of NTv2_0.gsb
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_with_subgrid.tif
+-------------------------------------------------------------------------------
+# In subgrid ALbanff, of parent CAwest
+accept -115.5416667 51.1666667 0
+expect -115.5427092888 51.1666899972 0
+
+# In subgrid ONtronto, of parent CAeast
+accept -80.5041667 44.5458333 0
+expect -80.50401615833 44.5458827236 0
+-------------------------------------------------------------------------------
+
+# Subset of NTv2_0.gsb
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_with_subgrid_no_grid_name.tif
+-------------------------------------------------------------------------------
+# In subgrid ALbanff, of parent CAwest
+accept -115.5416667 51.1666667 0
+expect -115.5427092888 51.1666899972 0
+
+# In subgrid ONtronto, of parent CAeast
+accept -80.5041667 44.5458333 0
+expect -80.50401615833 44.5458827236 0
+-------------------------------------------------------------------------------
+
+# Check a nested grid of a nested grid only based on spatial extent analysis
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_hgrid_with_two_level_of_subgrids_no_grid_name.tif
+-------------------------------------------------------------------------------
+accept -45.0 22.5
+accept -44.9983333334 22.5013888889
+
+# Check a nested grid of a nested grid only based on spatial extent analysis
+-------------------------------------------------------------------------------
+operation +proj=vgridshift +grids=tests/test_hgrid_with_two_level_of_subgrids_no_grid_name.tif +multiplier=1
+-------------------------------------------------------------------------------
+accept -45.0 22.5 0
+accept -45.0 22.5 5
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_vgrid.tif
+-------------------------------------------------------------------------------
+expect failure errno failed_to_load_grid
+-------------------------------------------------------------------------------
+
+
+# IGNF:LAMBE to IGNF:LAMB93 using xyzgridshift operation
+-------------------------------------------------------------------------------
+operation +proj=pipeline
+ +step +inv +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0
+ +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=clrk80ign +pm=paris
+ +step +proj=push +v_3
+ +step +proj=cart +ellps=clrk80ign
+ +step +proj=xyzgridshift +grids=tests/subset_of_gr3df97a.tif +grid_ref=output_crs +ellps=GRS80
+ +step +proj=cart +ellps=GRS80 +inv
+ +step +proj=pop +v_3
+ +step +proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44
+ +x_0=700000 +y_0=6600000 +ellps=GRS80
+-------------------------------------------------------------------------------
+tolerance 1 mm
+
+accept 814149.529 1887019.768 0
+expect 860690.804 6319036.849 0
+# If using ntf_r93.gsb, one gets: 860690.805 6319036.850
+
+roundtrip 1
+-------------------------------------------------------------------------------
+
+
+</gie>