From a9bc6e5fb000f618c9df6276f4ef79063ce4cdfc Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 26 Feb 2020 20:36:33 +0100 Subject: Make tests independent of proj-datumgrid Fixes #1984 - Copy BETA2007.gsb, MD, alaska, conus, ntf_r93.gsb, ntv1_can.dat grids from proj-datumgrid to data/tests. - Replace a couple uses of nzgd2kgrid0005.gsb in tests by ntf_r93.gsb - Add downsampled/subsetted versions of egm96_15.gtx as tests/egm96_15_downsampled.gtx and ntv2_0.gsb as tests/ntv2_0_downsampled.gsb This results in a few changes in expected results - Simpify travis/install.sh due to less configurations to test This results in a hopefully acceptable increase of the proj-X.Y.Z.tar.gz from 2.9 to 5.3 MB --- .cirrus.yml | 3 - .travis.yml | 1 - appveyor.yml | 3 - cmake/ProjTest.cmake | 24 ++---- data/CMakeLists.txt | 32 ++++---- data/Makefile.am | 41 +++++++--- data/tests/BETA2007.gsb | Bin 0 -> 83696 bytes data/tests/MD | Bin 0 -> 3560 bytes data/tests/alaska | Bin 0 -> 1053928 bytes data/tests/conus | Bin 0 -> 264424 bytes data/tests/egm96_15_downsampled.gtx | Bin 0 -> 259240 bytes data/tests/ntf_r93.gsb | Bin 0 -> 277424 bytes data/tests/ntv1_can.dat | Bin 0 -> 1113184 bytes data/tests/ntv2_0_downsampled.gsb | Bin 0 -> 245824 bytes test/cli/CMakeLists.txt | 6 +- test/cli/Makefile.am | 12 +-- test/cli/ntv2_out.dist | 16 ++-- test/cli/td_out.dist | 2 +- test/gie/4D-API_cs2cs-style.gie | 48 +++++------ test/gie/DHDN_ETRS89.gie | 1 - test/gie/deformation.gie | 10 +-- test/gie/more_builtins.gie | 39 +++------ test/unit/test_c_api.cpp | 17 +--- travis/install.sh | 155 +++++++++++++++--------------------- travis/mingw32/install.sh | 23 +----- 25 files changed, 177 insertions(+), 256 deletions(-) create mode 100644 data/tests/BETA2007.gsb create mode 100644 data/tests/MD create mode 100644 data/tests/alaska create mode 100644 data/tests/conus create mode 100644 data/tests/egm96_15_downsampled.gtx create mode 100644 data/tests/ntf_r93.gsb create mode 100644 data/tests/ntv1_can.dat create mode 100644 data/tests/ntv2_0_downsampled.gsb diff --git a/.cirrus.yml b/.cirrus.yml index 0a2cb3cb..86e90ae2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -18,9 +18,6 @@ task: pkginstall_script: - pkg install -y autoconf automake libtool pkgconf sqlite3 tiff ccache gmake - download_grid_script: - - fetch https://download.osgeo.org/proj/proj-datumgrid-1.8.zip - - (cd data && tar xvf ../proj-datumgrid-1.8.zip) configure_script: - ./autogen.sh - CC="ccache cc" CXX="ccache c++" ./configure --disable-static diff --git a/.travis.yml b/.travis.yml index 8ebf6127..82b7bbdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,6 @@ matrix: - TIFF_LIBS="-L/usr/lib/i386-linux-gnu -ltiff" - SQLITE3_CFLAGS=-I/usr/include/i386-linux-gnu - SQLITE3_LIBS="-L/usr/lib/i386-linux-gnu -lsqlite3" - - SKIP_BUILDS_WITHOUT_GRID=yes addons: apt: sources: diff --git a/appveyor.yml b/appveyor.yml index fdce5268..2d5e0f2e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,9 +35,6 @@ build_script: - if "%platform%" == "x86" SET BUILD_SHARED_LIBS=OFF - echo "%VS_FULL%" # - - cd %APPVEYOR_BUILD_FOLDER%\data - - curl -O https://download.osgeo.org/proj/proj-datumgrid-1.8.zip - - 7z e -aoa -y proj-datumgrid-1.8.zip - set PROJ_BUILD=%APPVEYOR_BUILD_FOLDER%\build - mkdir %PROJ_BUILD% - cd %PROJ_BUILD% diff --git a/cmake/ProjTest.cmake b/cmake/ProjTest.cmake index 8930a561..04f40c5d 100644 --- a/cmake/ProjTest.cmake +++ b/cmake/ProjTest.cmake @@ -11,24 +11,12 @@ function(proj_add_test_script_sh SH_NAME BIN_USE) if(UNIX) get_filename_component(testname ${SH_NAME} NAME_WE) - set(TEST_OK 1) - if(ARGV2) - set(TEST_OK 0) - set(GRID_FULLNAME ${PROJECT_SOURCE_DIR}/data/${ARGV2}) - if(EXISTS ${GRID_FULLNAME}) - set(TEST_OK 1) - endif() - endif() - - if(${TEST_OK}) - add_test(NAME "${testname}" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/data - COMMAND bash ${PROJECT_SOURCE_DIR}/test/cli/${SH_NAME} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${${BIN_USE}} - ) - - proj_test_set_properties(${testname}) - endif() + add_test(NAME "${testname}" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/data + COMMAND bash ${PROJECT_SOURCE_DIR}/test/cli/${SH_NAME} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${${BIN_USE}} + ) + proj_test_set_properties(${testname}) endif() endfunction() diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 53848a67..fa2e35d5 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -70,30 +70,34 @@ set(DATA_FOR_TESTS GL27 nad27 nad83 - ntv1_can.dat - MD - ntf_r93.gsb - egm96_15.gtx - ntv2_0.gsb - conus - alaska - nzgd2kgrid0005.gsb - ITRF2000 - BETA2007.gsb) -file(GLOB DATA_TESTS tests/*) + ITRF2000) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/for_tests) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/for_tests/tests) + foreach(FILE ${DATA_FOR_TESTS} ${CONFIG_FILES}) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/${FILE} COPYONLY) - endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/${FILE} COPYONLY) endforeach() + +file(GLOB DATA_TESTS tests/*) foreach(FILE ${DATA_TESTS}) get_filename_component(FILENAME ${FILE} NAME) configure_file(${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/tests/${FILENAME} COPYONLY) endforeach() +set(DATA_FOR_TESTS_FROM_TESTS_SUBDIR + alaska + BETA2007.gsb + conus + MD + ntf_r93.gsb + ntv1_can.dat) +foreach(FILE ${DATA_FOR_TESTS_FROM_TESTS_SUBDIR}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/${FILE} COPYONLY) +endforeach() +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/egm96_15_downsampled.gtx ${CMAKE_CURRENT_BINARY_DIR}/for_tests/egm96_15.gtx COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/ntv2_0_downsampled.gsb ${CMAKE_CURRENT_BINARY_DIR}/for_tests/ntv2_0.gsb COPYONLY) + # #install # diff --git a/data/Makefile.am b/data/Makefile.am index e284c6e0..8dbfed1b 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -89,6 +89,14 @@ EXTRA_DIST = proj.ini GL27 nad.lst nad27 nad83 \ tests/us_noaa_geoid06_ak_subset_at_antimeridian.tif \ tests/test_hgrid_little_endian.gsb \ tests/test_hgrid_big_endian.gsb \ + tests/BETA2007.gsb \ + tests/MD \ + tests/alaska \ + tests/conus \ + tests/egm96_15_downsampled.gtx \ + tests/ntv1_can.dat \ + tests/ntv2_0_downsampled.gsb \ + tests/ntf_r93.gsb \ generate_all_sql_in.cmake sql_filelist.cmake \ $(SQL_ORDERED_LIST) @@ -143,6 +151,19 @@ proj.db: $(DATAPATH)/sql/*.sql # For out-of-tree builds, link all file of the source data dir to the generated data # Also link select resource files in a for_tests subdirectory so that we are not # influenced by the presence of other grids + +# egm96_15_downsampled.gtx created with +# gdal_translate proj-datumgrid/egm96_15.gtx egm96_15_downsampled.gtx -of GTX -outsize 25% 25% -r average + +# ntv2_0_downsampled.gsb created with: +# gdal_translate NTv2:0:/home/even/proj/proj-datumgrid/north-america/ntv2_0.gsb /tmp/ntv2_0_downsampled.gsb -of NTv2 -outsize 10% 10% +# gdal_translate NTv2:1:/home/even/proj/proj-datumgrid/north-america/ntv2_0.gsb /tmp/ntv2_0_downsampled.gsb -of NTv2 -outsize 10% 10% -co append_subdataset=yes +# gdal_translate NTv2:2:/home/even/proj/proj-datumgrid/north-america/ntv2_0.gsb /tmp/ntv2_0_downsampled.gsb -of NTv2 -outsize 10% 10% -co append_subdataset=yes +# gdal_translate NTv2:3:/home/even/proj/proj-datumgrid/north-america/ntv2_0.gsb /tmp/ntv2_0_downsampled.gsb -of NTv2 -outsize 10% 10% -co append_subdataset=yes +# gdal_translate NTv2:99:/home/even/proj/proj-datumgrid/north-america/ntv2_0.gsb /tmp/ntv2_0_downsampled.gsb -of NTv2 -co append_subdataset=yes +# gdal_translate NTv2:44:/home/even/proj/proj-datumgrid/north-america/ntv2_0.gsb /tmp/ntv2_0_downsampled.gsb -of NTv2 -co append_subdataset=yes +# gdal_translate NTv2:4:/home/even/proj/proj-datumgrid/north-america/ntv2_0.gsb /tmp/ntv2_0_downsampled.gsb -of NTv2 -co append_subdataset=yes + check-local: @if [ ! -f GL27 ]; then \ for x in $(DATAPATH)/*; do \ @@ -154,24 +175,24 @@ check-local: for x in $(DATAPATH)/GL27 \ $(DATAPATH)/nad27 \ $(DATAPATH)/nad83 \ - $(DATAPATH)/ntv1_can.dat \ - $(DATAPATH)/MD \ - $(DATAPATH)/ntf_r93.gsb \ - $(DATAPATH)/egm96_15.gtx \ - $(DATAPATH)/ntv2_0.gsb \ - $(DATAPATH)/conus \ - $(DATAPATH)/alaska \ - $(DATAPATH)/nzgd2kgrid0005.gsb \ + $(DATAPATH)/tests/ntv1_can.dat \ + $(DATAPATH)/tests/MD \ + $(DATAPATH)/tests/ntf_r93.gsb \ + $(DATAPATH)/tests/conus \ + $(DATAPATH)/tests/alaska \ $(DATAPATH)/ITRF2000 \ - $(DATAPATH)/BETA2007.gsb; \ + $(DATAPATH)/tests/BETA2007.gsb; \ do \ if test -f "$$x" ; then \ ln -sf "../$$x" for_tests; \ else \ - echo "WARNING: grid $$x missing: some tests will be skipped"; \ + echo "ERROR: grid $$x missing: some tests will be skipped"; \ + exit 1; \ fi \ done; \ ln -sf ../$(DATAPATH)/tests for_tests; \ + ln -sf ../$(DATAPATH)/tests/ntv2_0_downsampled.gsb for_tests/ntv2_0.gsb; \ + ln -sf ../$(DATAPATH)/tests/egm96_15_downsampled.gtx for_tests/egm96_15.gtx; \ ln -sf ../$(DATAPATH)/proj.ini for_tests; \ ln -sf ../proj.db for_tests diff --git a/data/tests/BETA2007.gsb b/data/tests/BETA2007.gsb new file mode 100644 index 00000000..69cd3346 Binary files /dev/null and b/data/tests/BETA2007.gsb differ diff --git a/data/tests/MD b/data/tests/MD new file mode 100644 index 00000000..c8500e97 Binary files /dev/null and b/data/tests/MD differ diff --git a/data/tests/alaska b/data/tests/alaska new file mode 100644 index 00000000..bb6be2ff Binary files /dev/null and b/data/tests/alaska differ diff --git a/data/tests/conus b/data/tests/conus new file mode 100644 index 00000000..44b4900f Binary files /dev/null and b/data/tests/conus differ diff --git a/data/tests/egm96_15_downsampled.gtx b/data/tests/egm96_15_downsampled.gtx new file mode 100644 index 00000000..ea53ab10 Binary files /dev/null and b/data/tests/egm96_15_downsampled.gtx differ diff --git a/data/tests/ntf_r93.gsb b/data/tests/ntf_r93.gsb new file mode 100644 index 00000000..07e34fcb Binary files /dev/null and b/data/tests/ntf_r93.gsb differ diff --git a/data/tests/ntv1_can.dat b/data/tests/ntv1_can.dat new file mode 100644 index 00000000..8acad077 Binary files /dev/null and b/data/tests/ntv1_can.dat differ diff --git a/data/tests/ntv2_0_downsampled.gsb b/data/tests/ntv2_0_downsampled.gsb new file mode 100644 index 00000000..06b81110 Binary files /dev/null and b/data/tests/ntv2_0_downsampled.gsb differ diff --git a/test/cli/CMakeLists.txt b/test/cli/CMakeLists.txt index cf4192d7..0f86ca3d 100644 --- a/test/cli/CMakeLists.txt +++ b/test/cli/CMakeLists.txt @@ -10,9 +10,9 @@ proj_add_test_script_sh("test27" PROJ_BIN) proj_add_test_script_sh("test83" PROJ_BIN) proj_add_test_script_sh("testproj" PROJ_BIN) proj_add_test_script_sh("testvarious" CS2CS_BIN) -proj_add_test_script_sh("testdatumfile" CS2CS_BIN "connu") -proj_add_test_script_sh("testIGNF" CS2CS_BIN "ntf_r93.gsb") -proj_add_test_script_sh("testntv2" CS2CS_BIN "ntv2_0.gsb") +proj_add_test_script_sh("testdatumfile" CS2CS_BIN) +proj_add_test_script_sh("testIGNF" CS2CS_BIN) +proj_add_test_script_sh("testntv2" CS2CS_BIN) proj_add_test_script_sh("testprojinfo" PROJINFO_BIN) proj_add_test_script_sh("testcct" CCT_BIN) if(BUILD_PROJSYNC_DATA) diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 7ff42016..4d11eaf3 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -47,19 +47,13 @@ testvarious-check: PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTVARIOUS) $(CS2CSEXE) testdatumfile-check: - @if [ -f $(PROJ_LIB)/conus -a -f $(PROJ_LIB)/ntv1_can.dat -a -f $(PROJ_LIB)/MD -a -f $(PROJ_LIB)/ntf_r93.gsb -a -f $(PROJ_LIB)/egm96_15.gtx ]; then \ - PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTDATUMFILE) $(CS2CSEXE) ; \ - fi + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTDATUMFILE) $(CS2CSEXE) testign-check: - @if [ -f $(PROJ_LIB)/ntf_r93.gsb ] ; then \ - PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTIGN) $(CS2CSEXE) ; \ - fi + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTIGN) $(CS2CSEXE) testntv2-check: - @if [ -f $(PROJ_LIB)/ntv2_0.gsb -a -f $(PROJ_LIB)/conus -a -f $(PROJ_LIB)/ntv1_can.dat ] ; then \ - PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTNTV2) $(CS2CSEXE) ; \ - fi + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTNTV2) $(CS2CSEXE) testcct-check: PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTCCT) $(CCTEXE) diff --git a/test/cli/ntv2_out.dist b/test/cli/ntv2_out.dist index d90fdc37..890a649b 100644 --- a/test/cli/ntv2_out.dist +++ b/test/cli/ntv2_out.dist @@ -3,27 +3,27 @@ Point in the ONwinsor subgrid. 82d00'00.000"W 42d00'00.000"N 0.0 81d59'59.6104"W 42d0'0.1602"N 0.000 82d00'01.000"W 42d00'00.000"N 0.0 82d0'0.6104"W 42d0'0.1602"N 0.000 82d00'02.000"W 42d00'00.000"N 0.0 82d0'1.6104"W 42d0'0.1602"N 0.000 -84d00'00.000"W 42d00'00.000"N 0.0 83d59'59.8593"W 42d0'0.18"N 0.000 +84d00'00.000"W 42d00'00.000"N 0.0 83d59'59.8623"W 42d0'0.1807"N 0.000 ############################################################## Try with NTv2 and NTv1 together ... falls back to NTv1 -99d00'00.000"W 65d00'00.000"N 0.0 99d0'1.5885"W 65d0'1.3482"N 0.000 +99d00'00.000"W 65d00'00.000"N 0.0 99d0'1.5926"W 65d0'1.3478"N 0.000 111d00'00.000"W 46d00'00.000"N 0.0 111d0'3.1897"W 45d59'59.7489"N 0.000 -111d00'00.000"W 47d30'00.000"N 0.0 111d0'2.7989"W 47d29'59.9896"N 0.000 +111d00'00.000"W 47d30'00.000"N 0.0 111d0'2.8054"W 47d29'59.9899"N 0.000 ############################################################## Switching between NTv2 subgrids --112.5839956 49.4914451 0 -112.58307487 49.49145197 0.00000000 +-112.5839956 49.4914451 0 -112.58307621 49.49144267 0.00000000 ############################################################## Interpolating very close (and sometimes a bit outside) to the edges a NTv2 subgrid (#209) -115.58333333 51.25000000 0 -115.58228512 51.24997866 0.00000000 -115.58333333 51.25000010 0 -115.58228512 51.24997876 0.00000000 -115.58333334 51.25000000 0 -115.58228513 51.24997866 0.00000000 --115.49166667 51.07500000 0 -115.49062909 51.07497666 0.00000000 --115.49166668 51.07500000 0 -115.49062910 51.07497666 0.00000000 --115.49166667 51.07499990 0 -115.49062909 51.07497656 0.00000000 +-115.49166667 51.07500000 0 -115.49063575 51.07497568 0.00000000 +-115.49166668 51.07500000 0 -115.49063576 51.07497568 0.00000000 +-115.49166667 51.07499990 0 -115.49063575 51.07497558 0.00000000 ############################################################## Attempt first with ntv2_0.gsb and then conus -111.5 45.26 -111.50079772 45.25992835 0.00000000 ############################################################## NAD27 -> NAD83: 1st through ntv2, 2nd through conus -55d00'00.000"N 111d00'00.000"W 0.0 55d0'0.366"N 111d0'3.251"W 0.000 +55d00'00.000"N 111d00'00.000"W 0.0 55d0'0.367"N 111d0'3.231"W 0.000 39d00'00.000"N 111d00'00.000"W 0.0 38d59'59.912"N 111d0'2.604"W 0.000 diff --git a/test/cli/td_out.dist b/test/cli/td_out.dist index cf4b8d73..ab0c0911 100644 --- a/test/cli/td_out.dist +++ b/test/cli/td_out.dist @@ -29,4 +29,4 @@ NAD27 -> NAD83: 1st through ntv1 or ntv2, 2nd through conus 39d00'00.000"N 111d00'00.000"W 0.0 39.0000 -111.0007 0.0000 ############################################################## WGS84 -> WGS84+EGM96 -2dE 49dN 0 2.00 49.00 -44.64 +2dE 49dN 0 2.00 49.00 -45.06 diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index b8512162..1dd2ae54 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -55,17 +55,16 @@ expect 16.8210462130 55.1705688946 29.0317 ------------------------------------------------------------------------------- -operation proj=latlong nadgrids=nzgd2kgrid0005.gsb ellps=GRS80 +operation proj=latlong nadgrids=ntf_r93.gsb ellps=GRS80 ------------------------------------------------------------------------------- -This functionality is also tested in DHDN_ETRS89.gie +This functionality is also tested in more_builtins.gie ------------------------------------------------------------------------------- tolerance 1 mm -ignore pjd_err_failed_to_load_grid -accept 173 -45 -expect 172.999892181021551 -45.001620431954613 +accept 2.25 46.5 +expect 2.250704350387 46.500051597273 direction inverse -accept 172.999892181021551 -45.001620431954613 -expect 173 -45 +accept 2.250704350387 46.500051597273 +expect 2.25 46.5 ------------------------------------------------------------------------------- @@ -74,24 +73,22 @@ expect 173 -45 operation proj=latlong geoidgrids=egm96_15.gtx ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm # lax tolerance due to widespread bad egm96 file -ignore pjd_err_failed_to_load_grid accept 12.5 55.5 0 -expect 12.5 55.5 -36.0213 +expect 12.5 55.5 -36.3941 direction inverse -accept 12.5 55.5 -36.0213 +accept 12.5 55.5 -36.3941 expect 12.5 55.5 0 ------------------------------------------------------------------------------- operation proj=merc geoidgrids=egm96_15.gtx ellps=GRS80 ------------------------------------------------------------------------------- tolerance 0.1 mm -ignore pjd_err_failed_to_load_grid accept 12.5 55.5 0 -expect 1391493.63492 7424275.19462 -36.0213 +expect 1391493.63492 7424275.19462 -36.3941 direction inverse -accept 1391493.63492 7424275.19462 -36.0213 +accept 1391493.63492 7424275.19462 -36.3941 expect 12.5 55.5 0 ------------------------------------------------------------------------------- @@ -107,32 +104,29 @@ with "unusual" axis orders operation proj=latlong geoidgrids=egm96_15.gtx axis=neu ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm # lax tolerance due to widely distributed, bad egm96 file -ignore pjd_err_failed_to_load_grid # Broken test. FIXME #accept 12.5 55.5 0 -#expect 55.5 12.5 -36.0213 +#expect 55.5 12.5 -36.3941 #direction inverse -#accept 55.5 12.5 -36.0213 +#accept 55.5 12.5 -36.3941 #expect 12.5 55.5 0 ------------------------------------------------------------------------------- operation proj=latlong geoidgrids=egm96_15.gtx axis=dne ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm # lax tolerance due to widely distributed, bad egm96 file -ignore pjd_err_failed_to_load_grid # accept 12.5 55.5 0 -# expect 36.0213 55.5 12.5 +# expect 36.3941 55.5 12.5 # direction inverse -# accept 36.0213 55.5 12.5 +# accept 36.3941 55.5 12.5 # expect 12.5 55.5 0 ------------------------------------------------------------------------------- operation proj=merc geoidgrids=egm96_15.gtx ellps=GRS80 ------------------------------------------------------------------------------- tolerance 0.1 mm -ignore pjd_err_failed_to_load_grid accept 12.5 55.5 0 -expect 1391493.63492 7424275.19462 -36.0213 +expect 1391493.63492 7424275.19462 -36.3941 direction inverse -accept 1391493.63492 7424275.19462 -36.0213 +accept 1391493.63492 7424275.19462 -36.3941 expect 12.5 55.5 0 ------------------------------------------------------------------------------- @@ -143,22 +137,20 @@ Some more complex axis swapping. operation proj=latlong geoidgrids=egm96_15.gtx axis=nue ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm # lax tolerance due to widely distributed, bad egm96 file -ignore pjd_err_failed_to_load_grid # Broken test. FIXME #accept 12.5 55.5 0 -#expect 55.5 -36.0213 12.5 +#expect 55.5 -36.3941 12.5 # direction inverse -# accept 55.5 -36.0213 12.5 +# accept 55.5 -36.3941 12.5 # expect 12.5 55.5 0 ------------------------------------------------------------------------------- operation proj=merc geoidgrids=egm96_15.gtx axis=sue ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm -ignore pjd_err_failed_to_load_grid accept 12.5 55.5 0 -expect -7424275.1946 -36.0213 1391493.6349 0.0000 +expect -7424275.1946 -36.3941 1391493.6349 0.0000 # direction inverse -# accept -7424275.1946 -36.0213 1391493.6349 0.0000 +# accept -7424275.1946 -36.3941 1391493.6349 0.0000 # expect 12.5 55.5 0 ------------------------------------------------------------------------------- diff --git a/test/gie/DHDN_ETRS89.gie b/test/gie/DHDN_ETRS89.gie index a1471a74..0ab577b8 100644 --- a/test/gie/DHDN_ETRS89.gie +++ b/test/gie/DHDN_ETRS89.gie @@ -6,7 +6,6 @@ operation proj=latlong datum=potsdam ellps=bessel DE_DHDN (BeTA, 2007) to ETRS89 using NTv2 grid. epsg:15948 ------------------------------------------------------------------------------- -require_grid BETA2007.gsb tolerance 1 mm accept 7.482506019176 53.498461143331 # ETRS89_Lat-Lon expect 7.483333333333 53.500000000000 # DE_DHDN_Lat-Lon diff --git a/test/gie/deformation.gie b/test/gie/deformation.gie index 848b9e89..b6616f52 100644 --- a/test/gie/deformation.gie +++ b/test/gie/deformation.gie @@ -49,7 +49,7 @@ operation +proj=deformation +xy_grids=alaska +z_grids=egm96_15.gtx tolerance 0.1 mm ignore pjd_err_failed_to_load_grid accept -3004295.5882503074 -1093474.1690603832 5500477.1338251457 -expect -3004295.7025 -1093474.2106 5500477.3444 +expect -3004295.7000 -1093474.2097 5500477.3397 roundtrip 5 # Test that errors are reported for coordinates outside the grid. @@ -70,7 +70,7 @@ tolerance 0.1 mm direction inverse ignore pjd_err_failed_to_load_grid accept -3004295.5882503074 -1093474.1690603832 5500477.1338251457 2000.0 -expect -3004295.7025 -1093474.2106 5500477.3444 2000.0 +expect -3004295.7000 -1093474.2097 5500477.3397 2000.0 roundtrip 5 ------------------------------------------------------------------------------- @@ -100,7 +100,7 @@ tolerance 0.1 mm ignore pjd_err_failed_to_load_grid accept 12 56 0.0 2000.0 -expect 12 56 -36.5966 2000.0 +expect 12 56 -36.9960 2000.0 roundtrip 100 accept 12 56 0.0 2011.0 @@ -112,7 +112,7 @@ expect 12 56 0.0 2019.0 roundtrip 100 accept 12 56 0.0 -expect 12 56 -36.5966 +expect 12 56 -36.9960 roundtrip 100 @@ -123,7 +123,7 @@ tolerance 0.1 mm ignore pjd_err_failed_to_load_grid accept 12 56 0.0 2000.0 -expect 12 56 -36.5966 2000.0 +expect 12 56 -36.9960 2000.0 roundtrip 100 accept 12 56 0.0 2011.0 diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 78a504ff..a3e9d398 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -241,35 +241,27 @@ Some tests from PJ_vgridshift.c ------------------------------------------------------------------------------- operation proj=vgridshift grids=egm96_15.gtx ellps=GRS80 ------------------------------------------------------------------------------- -Appears there is a difference between the egm96_15.gtx distributed by OSGeo4W, -and the one from https://download.osgeo.org/proj/vdatum/egm96_15/egm96_15.gtx -N(12.5, 55.5) = -36.021305084228515625 (download.osgeo.org) -N(12.5, 55.5) = -35.880001068115234000 (OSGeo4W) -This is annoying, but must be handled elsewhere. We jump through the hoop by -setting a very lax tolerance. -------------------------------------------------------------------------------- -tolerance 15 cm -ignore pjd_err_failed_to_load_grid +tolerance 1 cm accept 12.5 55.5 0 0 -expect 12.5 55.5 -36.021305084228516 0 +expect 12.5 55.5 -36.394090697 0 accept -180.1 0 0 -expect -180.1 0 -21.2423 +expect -180.1 0 -20.835222268 accept 179.9 0 0 -expect 179.9 0 -21.2423 +expect 179.9 0 -20.835222268 accept 180 0 0 -expect 180 0 -21.1533 +expect 180 0 -20.756538510 accept 540 0 0 -expect 540 0 -21.1533 +expect 540 0 -20.756538510 accept -180 0 0 -expect -180 0 -21.1533 +expect -180 0 -20.756538510 accept -540 0 0 -expect -540 0 -21.1533 +expect -540 0 -20.756538510 roundtrip 100 1 nm ------------------------------------------------------------------------------- @@ -285,25 +277,20 @@ expect failure errno failed_to_load_grid ------------------------------------------------------------------------------- operation proj=vgridshift grids=egm96_15.gtx ellps=GRS80 multiplier=0.1 tolerance 15 cm -ignore pjd_err_failed_to_load_grid accept 12.5 55.5 0 0 expect 12.5 55.5 3.6021305084228516 0 ------------------------------------------------------------------------------- Some tests from PJ_hgridshift.c ------------------------------------------------------------------------------- -operation proj=hgridshift +grids=nzgd2kgrid0005.gsb ellps=GRS80 -------------------------------------------------------------------------------- -Note: These data are home grown and suitable for regression testing only -We need a set of authoritative test cases to test the nzgd2000 grid. +operation proj=hgridshift +grids=ntf_r93.gsb ellps=GRS80 ------------------------------------------------------------------------------- tolerance 1 mm -ignore pjd_err_failed_to_load_grid -accept 172.999892181021551 -45.001620431954613 -expect 173 -45 +accept 2.250704350387 46.500051597273 +expect 2.25 46.5 direction inverse -accept 173 -45 -expect 172.999892181021551 -45.001620431954613 +accept 2.25 46.5 +expect 2.250704350387 46.500051597273 ------------------------------------------------------------------------------- diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 12a48a65..0f1b906e 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -4144,10 +4144,7 @@ TEST_F(CApi, proj_create_crs_to_crs_with_only_ballpark_transformations) { coord = proj_trans(Pnormalized, PJ_FWD, coord); EXPECT_NEAR(coord.xyzt.x, 3.0, 1e-9); EXPECT_NEAR(coord.xyzt.y, 40.65085651660555, 1e-9); - if (coord.xyzt.z != 0) { - // z will depend if the egm96_15.gtx grid is there or not - EXPECT_NEAR(coord.xyzt.z, 47.04784081844435, 1e-3); - } + EXPECT_NEAR(coord.xyzt.z, 47.72600023608570, 1e-3); } // --------------------------------------------------------------------------- @@ -4156,10 +4153,6 @@ TEST_F( CApi, proj_create_crs_to_crs_from_custom_compound_crs_with_NAD83_2011_and_geoidgrid_ref_against_WGS84_to_WGS84_G1762) { - if (strcmp(proj_grid_info("egm96_15.gtx").format, "missing") == 0) { - return; // use GTEST_SKIP() if we upgrade gtest - } - PJ *P; PJ *inCrsH = proj_create_from_database(m_ctxt, "EPSG", "6340", @@ -4214,7 +4207,7 @@ TEST_F( EXPECT_NEAR(outcoord.xyzt.x, 35.09499307271, 1e-9); EXPECT_NEAR(outcoord.xyzt.y, -118.64014868921, 1e-9); - EXPECT_NEAR(outcoord.xyzt.z, 118.059, 1e-3); + EXPECT_NEAR(outcoord.xyzt.z, 117.655, 1e-3); } // --------------------------------------------------------------------------- @@ -4223,10 +4216,6 @@ TEST_F( CApi, proj_create_crs_to_crs_from_custom_compound_crs_with_NAD83_2011_and_geoidgrid_ref_against_NAD83_2011_to_WGS84_G1762) { - if (strcmp(proj_grid_info("egm96_15.gtx").format, "missing") == 0) { - return; // use GTEST_SKIP() if we upgrade gtest - } - PJ *P; // NAD83(2011) 2D @@ -4278,7 +4267,7 @@ TEST_F( EXPECT_NEAR(outcoord.xyzt.x, 35.000003665064803, 1e-9); EXPECT_NEAR(outcoord.xyzt.y, -118.00001414221214, 1e-9); - EXPECT_NEAR(outcoord.xyzt.z, -32.5823, 1e-3); + EXPECT_NEAR(outcoord.xyzt.z, -32.8110, 1e-3); } // --------------------------------------------------------------------------- diff --git a/travis/install.sh b/travis/install.sh index b0c16881..701eef21 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -13,82 +13,81 @@ if test "x${NPROC}" = "x"; then fi echo "NPROC=${NPROC}" -# Download grid files -wget https://download.osgeo.org/proj/proj-datumgrid-1.8.zip -wget "https://github.com/OSGeo/proj-datumgrid/blob/master/north-america/ntv2_0.gsb?raw=true" -O ntv2_0.gsb - # prepare build files ./autogen.sh TOP_DIR=$PWD -if [ "$SKIP_BUILDS_WITHOUT_GRID" != "yes" ]; then - - # autoconf build - mkdir build_autoconf - cd build_autoconf - ../configure - make dist-all - # Check consistency of generated tarball - TAR_FILENAME=`ls *.tar.gz` - TAR_DIRECTORY=`basename $TAR_FILENAME .tar.gz` - tar xvzf $TAR_FILENAME - cd $TAR_DIRECTORY +# autoconf build +mkdir build_autoconf +cd build_autoconf +../configure +make dist-all +# Check consistency of generated tarball +TAR_FILENAME=`ls *.tar.gz` +TAR_DIRECTORY=`basename $TAR_FILENAME .tar.gz` +tar xvzf $TAR_FILENAME +cd $TAR_DIRECTORY + +# There's a nasty #define CS in a Solaris system header. Avoid being caught about that again +CXXFLAGS="-DCS=do_not_use_CS_for_solaris_compat $CXXFLAGS" + +# autoconf build from generated tarball +mkdir build_autoconf +cd build_autoconf +../configure --prefix=/tmp/proj_autoconf_install_from_dist_all - # There's a nasty #define CS in a Solaris system header. Avoid being caught about that again - CXXFLAGS="-DCS=do_not_use_CS_for_solaris_compat $CXXFLAGS" +make -j${NPROC} - # autoconf build from generated tarball - mkdir build_autoconf - cd build_autoconf - ../configure --prefix=/tmp/proj_autoconf_install_from_dist_all +if [ "$(uname)" == "Linux" -a -f src/.libs/libproj.so ]; then +if objdump -TC "$1" | grep "elf64-x86-64">/dev/null; then + echo "Checking exported symbols..." + ${TOP_DIR}/scripts/dump_exported_symbols.sh src/.libs/libproj.so > /tmp/got_symbols.txt + diff -u ${TOP_DIR}/scripts/reference_exported_symbols.txt /tmp/got_symbols.txt || (echo "Difference(s) found in exported symbols. If intended, refresh scripts/reference_exported_symbols.txt with 'scripts/dump_exported_symbols.sh src/.libs/libproj.so > scripts/reference_exported_symbols.txt'"; exit 1) +fi +fi - make -j${NPROC} +make check +make install +find /tmp/proj_autoconf_install_from_dist_all + +/tmp/proj_autoconf_install_from_dist_all/bin/projinfo EPSG:32631 -o PROJJSON -q > out.json +cat out.json +echo "Validating JSON" +jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" + +/tmp/proj_autoconf_install_from_dist_all/bin/projinfo EPSG:4326+3855 -o PROJJSON -q > out.json +cat out.json +echo "Validating JSON" +jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" + +/tmp/proj_autoconf_install_from_dist_all/bin/projinfo "+proj=longlat +ellps=GRS80 +nadgrids=@foo +type=crs" -o PROJJSON -q > out.json +cat out.json +echo "Validating JSON" +jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" +/tmp/proj_autoconf_install_from_dist_all/bin/projinfo @out.json -o PROJJSON -q > out2.json +diff -u out.json out2.json + +/tmp/proj_autoconf_install_from_dist_all/bin/projinfo -s EPSG:3111 -t GDA2020 -o PROJJSON -o PROJJSON -q > out.json +cat out.json +echo "Validating JSON" +jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" +/tmp/proj_autoconf_install_from_dist_all/bin/projinfo @out.json -o PROJJSON -q > out2.json +diff -u out.json out2.json - if [ "$(uname)" == "Linux" -a -f src/.libs/libproj.so ]; then - if objdump -TC "$1" | grep "elf64-x86-64">/dev/null; then - echo "Checking exported symbols..." - ${TOP_DIR}/scripts/dump_exported_symbols.sh src/.libs/libproj.so > /tmp/got_symbols.txt - diff -u ${TOP_DIR}/scripts/reference_exported_symbols.txt /tmp/got_symbols.txt || (echo "Difference(s) found in exported symbols. If intended, refresh scripts/reference_exported_symbols.txt with 'scripts/dump_exported_symbols.sh src/.libs/libproj.so > scripts/reference_exported_symbols.txt'"; exit 1) - fi - fi +# Test make clean target +make clean - make check - make install - find /tmp/proj_autoconf_install_from_dist_all - - /tmp/proj_autoconf_install_from_dist_all/bin/projinfo EPSG:32631 -o PROJJSON -q > out.json - cat out.json - echo "Validating JSON" - jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" - - /tmp/proj_autoconf_install_from_dist_all/bin/projinfo EPSG:4326+3855 -o PROJJSON -q > out.json - cat out.json - echo "Validating JSON" - jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" - - /tmp/proj_autoconf_install_from_dist_all/bin/projinfo "+proj=longlat +ellps=GRS80 +nadgrids=@foo +type=crs" -o PROJJSON -q > out.json - cat out.json - echo "Validating JSON" - jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" - /tmp/proj_autoconf_install_from_dist_all/bin/projinfo @out.json -o PROJJSON -q > out2.json - diff -u out.json out2.json - - /tmp/proj_autoconf_install_from_dist_all/bin/projinfo -s EPSG:3111 -t GDA2020 -o PROJJSON -o PROJJSON -q > out.json - cat out.json - echo "Validating JSON" - jsonschema -i out.json /tmp/proj_autoconf_install_from_dist_all/share/proj/projjson.schema.json && echo "Valid !" - /tmp/proj_autoconf_install_from_dist_all/bin/projinfo @out.json -o PROJJSON -q > out2.json - diff -u out.json out2.json +cd .. - cd .. +if [ $TRAVIS_OS_NAME != "osx" ]; then + # Check that we can retrieve the resource directory in a relative way after renaming the installation prefix + mkdir /tmp/proj_autoconf_install_from_dist_all_renamed + mv /tmp/proj_autoconf_install_from_dist_all /tmp/proj_autoconf_install_from_dist_all_renamed/subdir + LD_LIBRARY_PATH=/tmp/proj_autoconf_install_from_dist_all_renamed/subdir/lib /tmp/proj_autoconf_install_from_dist_all_renamed/subdir/bin/projsync --source-id ? --dry-run --system-directory || /bin/true + LD_LIBRARY_PATH=/tmp/proj_autoconf_install_from_dist_all_renamed/subdir/lib /tmp/proj_autoconf_install_from_dist_all_renamed/subdir/bin/projsync --source-id ? --dry-run --system-directory 2>/dev/null | grep "Downloading from https://cdn.proj.org into /tmp/proj_autoconf_install_from_dist_all_renamed/subdir/share/proj" +fi - if [ $TRAVIS_OS_NAME != "osx" ]; then - # Check that we can retrieve the resource directory in a relative way after renaming the installation prefix - mkdir /tmp/proj_autoconf_install_from_dist_all_renamed - mv /tmp/proj_autoconf_install_from_dist_all /tmp/proj_autoconf_install_from_dist_all_renamed/subdir - LD_LIBRARY_PATH=/tmp/proj_autoconf_install_from_dist_all_renamed/subdir/lib /tmp/proj_autoconf_install_from_dist_all_renamed/subdir/bin/projsync --source-id ? --dry-run --system-directory || /bin/true - LD_LIBRARY_PATH=/tmp/proj_autoconf_install_from_dist_all_renamed/subdir/lib /tmp/proj_autoconf_install_from_dist_all_renamed/subdir/bin/projsync --source-id ? --dry-run --system-directory 2>/dev/null | grep "Downloading from https://cdn.proj.org into /tmp/proj_autoconf_install_from_dist_all_renamed/subdir/share/proj" - fi +if [ "$BUILD_NAME" != "linux_gcc8" ]; then # cmake build from generated tarball mkdir build_cmake @@ -110,28 +109,6 @@ if [ "$SKIP_BUILDS_WITHOUT_GRID" != "yes" ]; then # return to root cd ../.. -fi - -# Install grid files -(cd data && unzip -o ../proj-datumgrid-1.8.zip && cp ../ntv2_0.gsb . ) - -# autoconf build with grids -mkdir build_autoconf_grids -cd build_autoconf_grids -../configure --prefix=/tmp/proj_autoconf_install_grids -make -j${NPROC} -make check -(cd src && make multistresstest && make test228) -PROJ_LIB=../data src/multistresstest -make install - -# Test make clean target -make clean - -find /tmp/proj_autoconf_install_grids -cd .. - -if [ "$SKIP_BUILDS_WITHOUT_GRID" != "yes" ]; then # There's an issue with the clang on Travis + coverage + cpp code if [ "$BUILD_NAME" != "linux_clang" ]; then @@ -147,10 +124,6 @@ if [ "$SKIP_BUILDS_WITHOUT_GRID" != "yes" ]; then make -j${NPROC} make check - # Rerun tests without grids not included in proj-datumgrid - rm -v data/egm96_15.gtx - make check - if [ "$BUILD_NAME" != "linux_clang" ]; then mv src/.libs/*.gc* src mv src/conversions/.libs/*.gc* src/conversions diff --git a/travis/mingw32/install.sh b/travis/mingw32/install.sh index 8c756ced..67873dd1 100755 --- a/travis/mingw32/install.sh +++ b/travis/mingw32/install.sh @@ -54,25 +54,6 @@ make dist-all find /tmp/proj_autoconf_install (cd test; make -j2) cp -r ../data/tests /tmp/proj_autoconf_install/share/proj +cp ../data/tests/egm96_15_downsampled.gtx /tmp/proj_autoconf_install/share/proj/egm96_15.gtx +cp ../data/tests/ntv2_0_downsampled.gsb /tmp/proj_autoconf_install/share/proj/ntv2_0.gsb test/unit/test_cpp_api.exe -cd .. -# Now with grids -wget https://download.osgeo.org/proj/proj-datumgrid-1.5.zip -cd data -unzip -o ../proj-datumgrid-1.5.zip -cd .. -# autoconf build with grids -mkdir build_autoconf_grids -cd build_autoconf_grids -CC="ccache $MINGW_ARCH-gcc" CXX="ccache $MINGW_ARCH-g++" LD=$MINGW_ARCH-ld ../configure --host=$MINGW_ARCH --prefix=/tmp/proj_autoconf_install_nad --without-curl -make -j2 -make install -find /tmp/proj_autoconf_install_nad -#make check -cd src -make multistresstest.exe -make test228.exe -cd .. -PROJ_LIB=../data src/multistresstest.exe -num_iterations 100000 -cd .. - -- cgit v1.2.3