From f5e5435fd5071d550e0d13f7a5d71e09c1fab2c0 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 8 Jan 2019 16:22:15 +0100 Subject: ISO19111: remove PROJ.5 specific format for CRS (refs #1214) As discussed in https://github.com/OSGeo/proj.4/issues/1214#issuecomment-452084720, the introduction of a new PROJ.5 format to export CRS using pipeline/unitconvert/axisswap as an attempt of improving the PROJ.4 format used by GDAL and other products is likely a dead-end since it is still lossy in many aspects and can cause confusion with coodinate operations. Consequently the PROJ_5 convention will be identical to PROJ_4 for CRS export. Note: on the import side, I've kept the code that could parse unitconvert and axisswap when building a CRS definition from a pipeline. It is there as a hidden feature as it was kind of a tear to remove that code in case it might still be useful... --- test/cli/testprojinfo_out.dist | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'test/cli') diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 1fd3bbbf..3d70bd99 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -1,6 +1,6 @@ Testing projinfo EPSG:4326 PROJ string: -+proj=pipeline +step +proj=longlat +ellps=WGS84 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 ++proj=longlat +datum=WGS84 +no_defs WKT2_2015 string: GEODCRS["WGS 84", @@ -22,9 +22,6 @@ GEODCRS["WGS 84", Testing projinfo -o ALL EPSG:4326 PROJ string: -+proj=pipeline +step +proj=longlat +ellps=WGS84 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 - -PROJ.4 string: +proj=longlat +datum=WGS84 +no_defs WKT2_2015 string: @@ -484,7 +481,7 @@ Alternative non-deprecated CRS: EPSG:3003 PROJ string: -+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=longlat +ellps=intl +pm=rome +step +proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +pm=rome ++proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +pm=rome +units=m +no_defs WKT2_2015 string: PROJCRS["Monte Mario (Rome) / Italy zone 1", @@ -529,7 +526,7 @@ Warning: Parsing error : syntax error, unexpected UNIT, expecting PRIMEM. Error HEROID["WGS 84",6378137,298.257223563]],UNIT["degree",0.0174532925199433]] ^ PROJ string: -+proj=pipeline +step +proj=longlat +ellps=WGS84 +step +proj=unitconvert +xy_in=rad +xy_out=deg ++proj=longlat +datum=WGS84 +no_defs WKT2_2015 string: GEODCRS["WGS 84", -- cgit v1.2.3 From a6899c98a6455dc022bdd6785af3e528488422b8 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 8 Jan 2019 17:44:49 +0100 Subject: projinfo: use PROJ.4 label for CRS, and PROJ otherwise. Add test case for CRS with towgs84 keyword --- test/cli/testprojinfo | 4 ++++ test/cli/testprojinfo_out.dist | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'test/cli') diff --git a/test/cli/testprojinfo b/test/cli/testprojinfo index bae38482..70e4912f 100755 --- a/test/cli/testprojinfo +++ b/test/cli/testprojinfo @@ -82,6 +82,10 @@ echo "Testing non compliant WKT1" >> ${OUT} $EXE 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],UNIT["degree",0.0174532925199433]]' >>${OUT} 2>&1 echo "" >>${OUT} +echo "Testing CRS with towgs84: projinfo -o PROJ EPSG:25832" >> ${OUT} +$EXE -o PROJ EPSG:25832 >>${OUT} 2>&1 +echo "" >>${OUT} + # do 'diff' with distribution results echo "diff ${OUT} with testprojinfo_out.dist" diff -u ${OUT} ${TEST_CLI_DIR}/testprojinfo_out.dist diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 3d70bd99..23e26975 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -1,5 +1,5 @@ Testing projinfo EPSG:4326 -PROJ string: +PROJ.4 string: +proj=longlat +datum=WGS84 +no_defs WKT2_2015 string: @@ -21,7 +21,7 @@ GEODCRS["WGS 84", ID["EPSG",4326]] Testing projinfo -o ALL EPSG:4326 -PROJ string: +PROJ.4 string: +proj=longlat +datum=WGS84 +no_defs WKT2_2015 string: @@ -480,7 +480,7 @@ Warning: object is deprecated Alternative non-deprecated CRS: EPSG:3003 -PROJ string: +PROJ.4 string: +proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +pm=rome +units=m +no_defs WKT2_2015 string: @@ -525,7 +525,7 @@ Warning: GEOGCS should have a PRIMEM node Warning: Parsing error : syntax error, unexpected UNIT, expecting PRIMEM. Error occurred around: HEROID["WGS 84",6378137,298.257223563]],UNIT["degree",0.0174532925199433]] ^ -PROJ string: +PROJ.4 string: +proj=longlat +datum=WGS84 +no_defs WKT2_2015 string: @@ -545,3 +545,7 @@ GEODCRS["WGS 84", ORDER[2], ANGLEUNIT["degree",0.0174532925199433]]] +Testing CRS with towgs84: projinfo -o PROJ EPSG:25832 +PROJ.4 string: ++proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + -- cgit v1.2.3