aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-12-06 21:08:59 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-12-10 17:49:00 +0100
commit1f01ecb90a751c8099a50e066616639f63522134 (patch)
treecd09851b7dcbdd279d6c808090916d981ae36ef8 /test
parent9f908ae47cfa70d3cdb2709a8ab5d8eeb10034fc (diff)
downloadPROJ-1f01ecb90a751c8099a50e066616639f63522134.tar.gz
PROJ-1f01ecb90a751c8099a50e066616639f63522134.zip
Add support for horizontal and vertical grids in GeoTIFF
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt1
-rwxr-xr-xtest/cli/test272
-rwxr-xr-xtest/cli/test832
-rwxr-xr-xtest/cli/testdatumfile6
-rw-r--r--test/gie/4D-API_cs2cs-style.gie2
-rw-r--r--test/gie/Makefile.am8
-rw-r--r--test/gie/geotiff_grids.gie283
7 files changed, 297 insertions, 7 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index ae721d46..a7aac755 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -10,6 +10,7 @@ proj_add_gie_test("GDA" "gie/GDA.gie")
proj_add_gie_test("4D-API-cs2cs-style" "gie/4D-API_cs2cs-style.gie")
proj_add_gie_test("DHDN_ETRS89" "gie/DHDN_ETRS89.gie")
proj_add_gie_test("Unitconvert" "gie/unitconvert.gie")
+proj_add_gie_test("geotiff_grids" "gie/geotiff_grids.gie")
# GIGS tests. Uncommented tests are expected to fail due to issues with
# various projections. Should be investigated further and fixed.
diff --git a/test/cli/test27 b/test/cli/test27
index bfc1cb0a..5825ed80 100755
--- a/test/cli/test27
+++ b/test/cli/test27
@@ -34,7 +34,7 @@ echo "Running ${0} using ${EXE}:"
echo "============================================"
OUT=proj_out27
-INIT_FILE=${PROJ_LIB}/nad27
+INIT_FILE=nad27
#
echo "doing tests into file ${OUT}, please wait"
#
diff --git a/test/cli/test83 b/test/cli/test83
index cfb1365e..8c1293d0 100755
--- a/test/cli/test83
+++ b/test/cli/test83
@@ -35,7 +35,7 @@ echo "Running ${0} using ${EXE}:"
echo "============================================"
OUT=proj_out83
-INIT_FILE=${PROJ_LIB}/nad83
+INIT_FILE=nad83
#
echo "doing tests into file ${OUT}, please wait"
#
diff --git a/test/cli/testdatumfile b/test/cli/testdatumfile
index 29a40876..9bd12ce4 100755
--- a/test/cli/testdatumfile
+++ b/test/cli/testdatumfile
@@ -27,7 +27,11 @@ echo "Running ${0} using ${EXE}:"
echo "============================================"
mkdir "dir with \" space"
-cp ${PROJ_LIB}/conus "dir with \" space/myconus"
+if test -f "${PROJ_LIB}/conus"; then
+ cp "${PROJ_LIB}/conus" "dir with \" space/myconus"
+else
+ cp "`dirname $0`/../../data/conus" "dir with \" space/myconus"
+fi
OUT=td_out
#EXE=../src/cs2cs
diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie
index 8d541823..3e4b9d2c 100644
--- a/test/gie/4D-API_cs2cs-style.gie
+++ b/test/gie/4D-API_cs2cs-style.gie
@@ -442,7 +442,6 @@ Test bugfix of https://github.com/OSGeo/proj.4/issues/1002
-------------------------------------------------------------------------------
operation +proj=latlong +ellps=WGS84 +geoidgrids=tests/test_nodata.gtx
-------------------------------------------------------------------------------
-ignore pjd_err_failed_to_load_grid
accept 4.05 52.1 0
expect 4.05 52.1 -10
-------------------------------------------------------------------------------
@@ -452,7 +451,6 @@ Test null grid with vgridshift
-------------------------------------------------------------------------------
operation proj=vgridshift grids=tests/test_nodata.gtx,null ellps=GRS80
-------------------------------------------------------------------------------
-ignore pjd_err_failed_to_load_grid
accept 4.05 52.1 0
expect 4.05 52.1 -10
diff --git a/test/gie/Makefile.am b/test/gie/Makefile.am
index 44facd87..ff333a14 100644
--- a/test/gie/Makefile.am
+++ b/test/gie/Makefile.am
@@ -9,7 +9,8 @@ EXTRA_DIST = 4D-API_cs2cs-style.gie \
ellipsoid.gie \
more_builtins.gie \
unitconvert.gie \
- DHDN_ETRS89.gie
+ DHDN_ETRS89.gie \
+ geotiff_grids.gie
PROJ_LIB ?= ../../data
@@ -40,4 +41,7 @@ unitconvert: unitconvert.gie
DHDN_ETRS89: DHDN_ETRS89.gie
PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
-check-local: 4D-API-cs2cs-style GDA axisswap builtins deformation ellipsoid more_builtins unitconvert DHDN_ETRS89
+geotiff_grids: geotiff_grids.gie
+ PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $<
+
+check-local: 4D-API-cs2cs-style GDA axisswap builtins deformation ellipsoid more_builtins unitconvert DHDN_ETRS89 geotiff_grids
diff --git a/test/gie/geotiff_grids.gie b/test/gie/geotiff_grids.gie
new file mode 100644
index 00000000..132ca6d4
--- /dev/null
+++ b/test/gie/geotiff_grids.gie
@@ -0,0 +1,283 @@
+
+-------------------------------------------------------------------------------
+===============================================================================
+Test GeoTIFF grids
+===============================================================================
+
+<gie>
+
+-------------------------------------------------------------------------------
+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
+-------------------------------------------------------------------------------
+
+-------------------------------------------------------------------------------
+operation +proj=hgridshift +grids=tests/test_vgrid.tif
+-------------------------------------------------------------------------------
+expect failure errno failed_to_load_grid
+-------------------------------------------------------------------------------
+
+
+</gie>