From baed8dae4980698873500dec16b158638df71318 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 31 Oct 2020 13:59:25 +0100 Subject: Make sure that remarks is preserved when substituting (EPSG) grid name by PROJ one --- test/cli/testprojinfo_out.dist | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'test/cli') diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 245bb258..7da5add7 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -317,7 +317,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (3)", SCOPE["Historic record only - now superseded - see remarks."], AREA["Canada - onshore and offshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon."], BBOX[40.04,-141.01,86.46,-47.74]], - ID["DERIVED_FROM(EPSG)",1312]] + ID["DERIVED_FROM(EPSG)",1312], + REMARK["Uses NTv1 method. Replaced in Quebec by code 1462 and elsewhere in 1997 by NTv2 (transformation code 1313). Input expects longitudes to be positive west; EPSG GeogCRS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east."]] ------------------------------------- Operation No. 2: @@ -371,7 +372,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (4)", SCOPE["Transformation of coordinates at 1m to 2m level of accuracy."], AREA["Canada - onshore - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon; offshore east coast."], BBOX[40.04,-141.01,83.17,-47.74]], - ID["DERIVED_FROM(EPSG)",1313]] + ID["DERIVED_FROM(EPSG)",1313], + REMARK["Uses NTv2 data files. Replaces NTv1 (transformation code 1312) except in Quebec. Input expects longitudes to be positive west; EPSG GeogCRS NAD27 (code 4267) and (code 4269) have longitudes positive east. May be used as tfm to WGS 84 - see code 1693."]] ------------------------------------- Operation No. 3: @@ -425,7 +427,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (1)", SCOPE["Transformation of coordinates at 0.2m level of accuracy."], AREA["United States (USA) - CONUS including EEZ -onshore and offshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming. US Gulf of Mexico (GoM) OCS."], BBOX[23.81,-129.17,49.38,-65.69]], - ID["DERIVED_FROM(EPSG)",1241]] + ID["DERIVED_FROM(EPSG)",1241], + REMARK["Uses NADCON method which expects longitudes positive west; EPSG GeogCRS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east."]] ------------------------------------- Operation No. 4: @@ -479,7 +482,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (2)", SCOPE["Geodesy."], AREA["United States (USA) - Alaska including EEZ."], BBOX[47.88,167.65,74.71,-129.99]], - ID["DERIVED_FROM(EPSG)",1243]] + ID["DERIVED_FROM(EPSG)",1243], + REMARK["Uses NADCON method which expects longitudes positive west; EPSG GeogCRS NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east. May be used as transformation to WGS 84 - see NAD27 to WGS 84 (85) (code 15864)."]] ------------------------------------- Operation No. 5: @@ -533,7 +537,8 @@ COORDINATEOPERATION["NAD27 to NAD83 (6)", SCOPE["Transformation of coordinates at 1m to 2m level of accuracy."], AREA["Canada - Quebec."], BBOX[44.99,-79.85,62.62,-57.1]], - ID["DERIVED_FROM(EPSG)",1573]] + ID["DERIVED_FROM(EPSG)",1573], + REMARK["Also distributed with file name QUE27-83.gsb. Replaces NAD27 to NAD83 (5) (code 1462). Uses NT method which expects longitudes positive west; EPSG GeogCRSs NAD27 (code 4267) and NAD83 (code 4269) have longitudes positive east."]] ------------------------------------- Operation No. 6: -- cgit v1.2.3 From 82695cce869e1bcf2eb2a8ff078b679b6a21c663 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Oct 2020 17:08:27 +0200 Subject: When reading from database, possibly return Geographic/GeodeticCRS with a DatumEnsemble, typically for WGS 84 and ETRS89 ('breaking change') --- test/cli/testprojinfo_out.dist | 116 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 103 insertions(+), 13 deletions(-) (limited to 'test/cli') diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 7da5add7..2d4990ee 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -4,9 +4,16 @@ PROJ.4 string: WKT2:2019 string: GEOGCRS["WGS 84", - DATUM["World Geodetic System 1984", + ENSEMBLE["World Geodetic System 1984 ensemble", + MEMBER["World Geodetic System 1984 (Transit)"], + MEMBER["World Geodetic System 1984 (G730)"], + MEMBER["World Geodetic System 1984 (G873)"], + MEMBER["World Geodetic System 1984 (G1150)"], + MEMBER["World Geodetic System 1984 (G1674)"], + MEMBER["World Geodetic System 1984 (G1762)"], ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]]], + LENGTHUNIT["metre",1]], + ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], CS[ellipsoidal,2], @@ -59,9 +66,16 @@ GEODCRS["WGS 84", Testing projinfo -o WKT2_2019 EPSG:4326 WKT2:2019 string: GEOGCRS["WGS 84", - DATUM["World Geodetic System 1984", + ENSEMBLE["World Geodetic System 1984 ensemble", + MEMBER["World Geodetic System 1984 (Transit)"], + MEMBER["World Geodetic System 1984 (G730)"], + MEMBER["World Geodetic System 1984 (G873)"], + MEMBER["World Geodetic System 1984 (G1150)"], + MEMBER["World Geodetic System 1984 (G1674)"], + MEMBER["World Geodetic System 1984 (G1762)"], ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]]], + LENGTHUNIT["metre",1]], + ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], CS[ellipsoidal,2], @@ -102,9 +116,16 @@ GEODCRS["WGS 84", WKT2:2019 string: GEOGCRS["WGS 84", - DATUM["World Geodetic System 1984", + ENSEMBLE["World Geodetic System 1984 ensemble", + MEMBER["World Geodetic System 1984 (Transit)"], + MEMBER["World Geodetic System 1984 (G730)"], + MEMBER["World Geodetic System 1984 (G873)"], + MEMBER["World Geodetic System 1984 (G1150)"], + MEMBER["World Geodetic System 1984 (G1674)"], + MEMBER["World Geodetic System 1984 (G1762)"], ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]]], + LENGTHUNIT["metre",1]], + ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], CS[ellipsoidal,2], @@ -142,13 +163,61 @@ PROJJSON: "$schema": "https://proj.org/schemas/v0.2/projjson.schema.json", "type": "GeographicCRS", "name": "WGS 84", - "datum": { - "type": "GeodeticReferenceFrame", - "name": "World Geodetic System 1984", + "datum_ensemble": { + "name": "World Geodetic System 1984 ensemble", + "members": [ + { + "name": "World Geodetic System 1984 (Transit)", + "id": { + "authority": "EPSG", + "code": 1166 + } + }, + { + "name": "World Geodetic System 1984 (G730)", + "id": { + "authority": "EPSG", + "code": 1152 + } + }, + { + "name": "World Geodetic System 1984 (G873)", + "id": { + "authority": "EPSG", + "code": 1153 + } + }, + { + "name": "World Geodetic System 1984 (G1150)", + "id": { + "authority": "EPSG", + "code": 1154 + } + }, + { + "name": "World Geodetic System 1984 (G1674)", + "id": { + "authority": "EPSG", + "code": 1155 + } + }, + { + "name": "World Geodetic System 1984 (G1762)", + "id": { + "authority": "EPSG", + "code": 1156 + } + } + ], "ellipsoid": { "name": "WGS 84", "semi_major_axis": 6378137, "inverse_flattening": 298.257223563 + }, + "accuracy": "2.0", + "id": { + "authority": "EPSG", + "code": 6326 } }, "coordinate_system": { @@ -1023,9 +1092,16 @@ PROJ.4 string: WKT2:2019 string: PROJCRS["WGS 84 / UTM zone 31N", BASEGEOGCRS["WGS 84", - DATUM["World Geodetic System 1984", + ENSEMBLE["World Geodetic System 1984 ensemble", + MEMBER["World Geodetic System 1984 (Transit)"], + MEMBER["World Geodetic System 1984 (G730)"], + MEMBER["World Geodetic System 1984 (G873)"], + MEMBER["World Geodetic System 1984 (G1150)"], + MEMBER["World Geodetic System 1984 (G1674)"], + MEMBER["World Geodetic System 1984 (G1762)"], ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]]], + LENGTHUNIT["metre",1]], + ENSEMBLEACCURACY[2.0]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], ID["EPSG",4979]], @@ -1198,9 +1274,23 @@ Testing -k operation EPSG:8457 -o PROJ -q Testing D_WGS_1984 WKT2:2019 string: -DATUM["World Geodetic System 1984", +ENSEMBLE["World Geodetic System 1984 ensemble", + MEMBER["World Geodetic System 1984 (Transit)", + ID["EPSG",1166]], + MEMBER["World Geodetic System 1984 (G730)", + ID["EPSG",1152]], + MEMBER["World Geodetic System 1984 (G873)", + ID["EPSG",1153]], + MEMBER["World Geodetic System 1984 (G1150)", + ID["EPSG",1154]], + MEMBER["World Geodetic System 1984 (G1674)", + ID["EPSG",1155]], + MEMBER["World Geodetic System 1984 (G1762)", + ID["EPSG",1156]], ELLIPSOID["WGS 84",6378137,298.257223563, - LENGTHUNIT["metre",1]], + LENGTHUNIT["metre",1], + ID["EPSG",7030]], + ENSEMBLEACCURACY[2.0], ID["EPSG",6326]] Testing -k datum D_WGS_1984 -- cgit v1.2.3 From 1e5acb00a0c0fc2533b9bce2e5803da10ed1d8d6 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Oct 2020 20:59:19 +0200 Subject: projinfo / createObjectsFromName(): support returning a datum ensemble --- test/cli/testprojinfo | 4 ++++ test/cli/testprojinfo_out.dist | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'test/cli') diff --git a/test/cli/testprojinfo b/test/cli/testprojinfo index 62713af5..c31cfef0 100755 --- a/test/cli/testprojinfo +++ b/test/cli/testprojinfo @@ -171,6 +171,10 @@ echo 'Testing -k datum EPSG:6326' >> ${OUT} $EXE -k datum EPSG:6326 >>${OUT} 2>&1 echo "" >>${OUT} +echo 'Testing -k ensemble WGS84' >> ${OUT} +$EXE -k ensemble WGS84 >>${OUT} 2>&1 +echo "" >>${OUT} + echo 'Testing -k operation EPSG:8457 -o PROJ -q' >> ${OUT} $EXE -k operation EPSG:8457 -o PROJ -q >>${OUT} 2>&1 echo "" >>${OUT} diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 2d4990ee..174f11d3 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -1260,6 +1260,27 @@ DATUM["World Geodetic System 1984", LENGTHUNIT["metre",1]], ID["EPSG",6326]] +Testing -k ensemble WGS84 +WKT2:2019 string: +ENSEMBLE["World Geodetic System 1984 ensemble", + MEMBER["World Geodetic System 1984 (Transit)", + ID["EPSG",1166]], + MEMBER["World Geodetic System 1984 (G730)", + ID["EPSG",1152]], + MEMBER["World Geodetic System 1984 (G873)", + ID["EPSG",1153]], + MEMBER["World Geodetic System 1984 (G1150)", + ID["EPSG",1154]], + MEMBER["World Geodetic System 1984 (G1674)", + ID["EPSG",1155]], + MEMBER["World Geodetic System 1984 (G1762)", + ID["EPSG",1156]], + ELLIPSOID["WGS 84",6378137,298.257223563, + LENGTHUNIT["metre",1], + ID["EPSG",7030]], + ENSEMBLEACCURACY[2.0], + ID["EPSG",6326]] + Testing -k operation EPSG:8457 -o PROJ -q +proj=pipeline +step +proj=axisswap +order=2,1 -- cgit v1.2.3 From af342bf74cd154b653a0f9d931d4ca17001650b9 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Tue, 10 Nov 2020 14:08:30 +0100 Subject: Allow cct to instantiate operations via object codes or names (#2419) Running cct like cct EPSG:8366 or cct "ITRF2014 to ETRF2014 (1)" is now possible. --- test/cli/testcct | 12 ++++++++++++ test/cli/testcct_out.dist | 7 +++++++ 2 files changed, 19 insertions(+) (limited to 'test/cli') diff --git a/test/cli/testcct b/test/cli/testcct index 3fb0dd95..bbe698bd 100755 --- a/test/cli/testcct +++ b/test/cli/testcct @@ -32,6 +32,18 @@ echo "Testing cct -d 8 +proj=merc +R=1" >> ${OUT} echo "90 45" 0 | $EXE -d 8 +proj=merc +R=1 >>${OUT} echo "" >>${OUT} +echo "Test cct with object code initialization" >> ${OUT} +echo "3541657.3778 948984.2343 5201383.5231 2020.5" | $EXE EPSG:8366 >>${OUT} + +echo "Test cct with object name initialization" >> ${OUT} +echo "3541657.3778 948984.2343 5201383.5231 2020.5" | $EXE "ITRF2014 to ETRF2014 (1)" >>${OUT} + +echo "Test cct with object code initialization and file input" >> ${OUT} +echo "3541657.3778 948984.2343 5201383.5231 2020.5" >> a +echo "3541658.0000 948985.0000 5201384.0000 2020.5" >> b +$EXE EPSG:8366 a b >>${OUT} +/bin/rm a b + # do 'diff' with distribution results echo "diff ${OUT} with testcct_out.dist" diff -u ${OUT} ${TEST_CLI_DIR}/testcct_out.dist diff --git a/test/cli/testcct_out.dist b/test/cli/testcct_out.dist index 44dd6964..7788f0bb 100644 --- a/test/cli/testcct_out.dist +++ b/test/cli/testcct_out.dist @@ -1,3 +1,10 @@ Testing cct -d 8 +proj=merc +R=1 1.57079633 0.88137359 0.00000000 inf +Test cct with object code initialization + 3541657.9112 948983.7503 5201383.2482 2020.5000 +Test cct with object name initialization + 3541657.9112 948983.7503 5201383.2482 2020.5000 +Test cct with object code initialization and file input + 3541657.9112 948983.7503 5201383.2482 2020.5000 + 3541658.5334 948984.5160 5201383.7251 2020.5000 -- cgit v1.2.3 From 6be4e25c66e805218c851d67157e4d1ddc0a761e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 10 Nov 2020 14:40:17 +0100 Subject: cct: allow @filename syntax Similarly as for projinfo, allow "cct @filename" to mean read filename and use its content as if it was provided inline. Useful for WKT or PROJJSON And a tiny improvements, when the object definition contains ':', only try proj_create_from_database() if the left part (authority name) matches a known authority, to avoid a warning. --- test/cli/testcct | 93 +++++++++++++++++++++++++++++++++++++++++++++++ test/cli/testcct_out.dist | 2 + 2 files changed, 95 insertions(+) (limited to 'test/cli') diff --git a/test/cli/testcct b/test/cli/testcct index bbe698bd..db7c70a9 100755 --- a/test/cli/testcct +++ b/test/cli/testcct @@ -44,6 +44,99 @@ echo "3541658.0000 948985.0000 5201384.0000 2020.5" >> b $EXE EPSG:8366 a b >>${OUT} /bin/rm a b +cat > in.wkt <> ${OUT} +echo "3541657.3778 948984.2343 5201383.5231 2020.5" | $EXE @in.wkt >>${OUT} +rm in.wkt + # do 'diff' with distribution results echo "diff ${OUT} with testcct_out.dist" diff -u ${OUT} ${TEST_CLI_DIR}/testcct_out.dist diff --git a/test/cli/testcct_out.dist b/test/cli/testcct_out.dist index 7788f0bb..353deb17 100644 --- a/test/cli/testcct_out.dist +++ b/test/cli/testcct_out.dist @@ -8,3 +8,5 @@ Test cct with object name initialization Test cct with object code initialization and file input 3541657.9112 948983.7503 5201383.2482 2020.5000 3541658.5334 948984.5160 5201383.7251 2020.5000 +Test cct with WKT in a file + 3541657.9112 948983.7503 5201383.2482 2020.5000 -- cgit v1.2.3 From d6f6862352d0caeb827c0c3ec98ccf9aa2f9a1d2 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 24 Nov 2020 16:41:06 +0100 Subject: createOperation(): add a ballpark vertical transformation when dealing with GEOIDMODEL[] --- test/cli/testprojinfo_out.dist | 69 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) (limited to 'test/cli') diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 174f11d3..8e8ef294 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -990,7 +990,7 @@ PROJ.4 string: +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs Testing RH2000 height to SWEREF99: projinfo -s EPSG:5613 -t EPSG:4977 -Candidate operations found: 1 +Candidate operations found: 2 ------------------------------------- Operation No. 1: @@ -1042,8 +1042,55 @@ COORDINATEOPERATION["Inverse of SWEREF99 to RH2000 height", BBOX[55.28,10.93,69.07,24.17]], ID["INVERSE(DERIVED_FROM(PROJ))","EPSG_4977_TO_EPSG_5613"]] +------------------------------------- +Operation No. 2: + +unknown id, Transformation from RH2000 height to SWEREF99 (ballpark vertical transformation, without ellipsoid height to vertical height correction), unknown accuracy, World, has ballpark transformation + +PROJ string: ++proj=noop + +WKT2:2019 string: +COORDINATEOPERATION["Transformation from RH2000 height to SWEREF99 (ballpark vertical transformation, without ellipsoid height to vertical height correction)", + SOURCECRS[ + VERTCRS["RH2000 height", + DYNAMIC[ + FRAMEEPOCH[2000]], + VDATUM["Rikets hojdsystem 2000"], + CS[vertical,1], + AXIS["gravity-related height (H)",up, + LENGTHUNIT["metre",1]], + ID["EPSG",5613]]], + TARGETCRS[ + GEOGCRS["SWEREF99", + DATUM["SWEREF99", + ELLIPSOID["GRS 1980",6378137,298.257222101, + LENGTHUNIT["metre",1]]], + PRIMEM["Greenwich",0, + ANGLEUNIT["degree",0.0174532925199433]], + CS[ellipsoidal,3], + AXIS["geodetic latitude (Lat)",north, + ORDER[1], + ANGLEUNIT["degree",0.0174532925199433]], + AXIS["geodetic longitude (Lon)",east, + ORDER[2], + ANGLEUNIT["degree",0.0174532925199433]], + AXIS["ellipsoidal height (h)",up, + ORDER[3], + LENGTHUNIT["metre",1]], + ID["EPSG",4977]]], + METHOD["Change of Vertical Unit", + ID["EPSG",1069]], + PARAMETER["Unit conversion scalar",1, + SCALEUNIT["unity",1], + ID["EPSG",1051]], + USAGE[ + SCOPE["unknown"], + AREA["World"], + BBOX[-90,-180,90,180]]] + Testing NAD83(2011) + NAVD88 height -> NAD83(2011) : projinfo -s EPSG:6349 -t EPSG:6319 --spatial-test intersects -o PROJ -Candidate operations found: 2 +Candidate operations found: 3 ------------------------------------- Operation No. 1: @@ -1070,8 +1117,16 @@ PROJ string: +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 +------------------------------------- +Operation No. 3: + +unknown id, Transformation from NAVD88 height to NAD83(2011) (ballpark vertical transformation, without ellipsoid height to vertical height correction), unknown accuracy, World, has ballpark transformation + +PROJ string: ++proj=noop + Testing NGF IGN69 height to RGF93: projinfo -s EPSG:5720 -t EPSG:4965 -o PROJ -Candidate operations found: 1 +Candidate operations found: 2 ------------------------------------- Operation No. 1: @@ -1085,6 +1140,14 @@ PROJ string: +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1 +------------------------------------- +Operation No. 2: + +unknown id, Transformation from NGF-IGN69 height to RGF93 (ballpark vertical transformation, without ellipsoid height to vertical height correction), unknown accuracy, World, has ballpark transformation + +PROJ string: ++proj=noop + Testing EPSG:32631 --3d PROJ.4 string: +proj=utm +zone=31 +datum=WGS84 +units=m +no_defs +type=crs -- cgit v1.2.3 From 24c3bbb299798db775ef10101ee8aa76f8320bbf Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 27 Nov 2020 23:43:28 +0100 Subject: testcct: create 'a' and 'b' from scratch --- test/cli/testcct | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/cli') diff --git a/test/cli/testcct b/test/cli/testcct index db7c70a9..7ba17181 100755 --- a/test/cli/testcct +++ b/test/cli/testcct @@ -39,8 +39,8 @@ echo "Test cct with object name initialization" >> ${OUT} echo "3541657.3778 948984.2343 5201383.5231 2020.5" | $EXE "ITRF2014 to ETRF2014 (1)" >>${OUT} echo "Test cct with object code initialization and file input" >> ${OUT} -echo "3541657.3778 948984.2343 5201383.5231 2020.5" >> a -echo "3541658.0000 948985.0000 5201384.0000 2020.5" >> b +echo "3541657.3778 948984.2343 5201383.5231 2020.5" > a +echo "3541658.0000 948985.0000 5201384.0000 2020.5" > b $EXE EPSG:8366 a b >>${OUT} /bin/rm a b -- cgit v1.2.3 From 24c74a4d1cead8df41a7f22c8f28b1bf9e884de9 Mon Sep 17 00:00:00 2001 From: Houder <74594217+Houder@users.noreply.github.com> Date: Sat, 28 Nov 2020 13:45:06 +0100 Subject: Use same arguments to printf format string for both radians and degrees in output by cct (#2453) Currently the output of the cct utility is different between radians and degrees (as expected by cct), because of a bug in cct: $ printf "1 2\n" | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad 1.0000000000 2.0000000000 0.0000 0.0000 $ printf "1 2\n" | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg 1.0000 2.0000 0.0000 0.0000 The arguments to the printf format string are as follows: * radians: width 14, precision 10 * degrees: width 13, precision 4 (this is by mistake. bug!) After the suggested fix has been applied, output will be the same for both radians and degrees: $ printf "1 2\n" | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad 1.0000000000 2.0000000000 0.0000 0.0000 $ printf "1 2\n" | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg 1.0000000000 2.0000000000 0.0000 0.0000 The cause of the bug is that cct does test if it "has radians to output", but "neglects" to test if it "has degrees to output", resulting in using different arguments to the printf format string in the latter case. The fix makes cct test if it "has either radians or degrees to output". --- test/cli/testcct | 22 ++++++++++++++++++++++ test/cli/testcct_out.dist | 14 ++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'test/cli') diff --git a/test/cli/testcct b/test/cli/testcct index 7ba17181..686931ea 100755 --- a/test/cli/testcct +++ b/test/cli/testcct @@ -32,6 +32,28 @@ echo "Testing cct -d 8 +proj=merc +R=1" >> ${OUT} echo "90 45" 0 | $EXE -d 8 +proj=merc +R=1 >>${OUT} echo "" >>${OUT} +# tests without specifying the number of decimals (by default: 10 for radians and degrees, 4 for meters) +echo "Testing echo 0.5 2 | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad" >> ${OUT} +echo 0.5 2 | $EXE -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad >> ${OUT} + +echo "Testing echo 0.5 2 | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg" >> ${OUT} +echo 0.5 2 | $EXE -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg >> ${OUT} + +echo "Testing echo 0.5 2 | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km" >> ${OUT} +echo 0.5 2 | $EXE -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km >> ${OUT} +echo "" >> ${OUT} + +# tests for which the number of decimals has been specified (-d 6) +echo "Testing echo 0.5 2 | cct -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad" >> ${OUT} +echo 0.5 2 | $EXE -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad >> ${OUT} + +echo "Testing echo 0.5 2 | cct -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg" >> ${OUT} +echo 0.5 2 | $EXE -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg >> ${OUT} + +echo "Testing echo 0.5 2 | cct -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km" >> ${OUT} +echo 0.5 2 | $EXE -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km >> ${OUT} +echo "" >> ${OUT} + echo "Test cct with object code initialization" >> ${OUT} echo "3541657.3778 948984.2343 5201383.5231 2020.5" | $EXE EPSG:8366 >>${OUT} diff --git a/test/cli/testcct_out.dist b/test/cli/testcct_out.dist index 353deb17..7762ace7 100644 --- a/test/cli/testcct_out.dist +++ b/test/cli/testcct_out.dist @@ -1,6 +1,20 @@ Testing cct -d 8 +proj=merc +R=1 1.57079633 0.88137359 0.00000000 inf +Testing echo 0.5 2 | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad + 0.5000000000 2.0000000000 0.0000 0.0000 +Testing echo 0.5 2 | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg + 0.5000000000 2.0000000000 0.0000 0.0000 +Testing echo 0.5 2 | cct -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km + 0.0005 0.0020 0.0000 0.0000 + +Testing echo 0.5 2 | cct -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad + 0.500000 2.000000 0.000000 0.0000 +Testing echo 0.5 2 | cct -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=deg + 0.500000 2.000000 0.000000 0.0000 +Testing echo 0.5 2 | cct -d 6 -z 0 -t 0 +proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=km + 0.000500 0.002000 0.000000 0.0000 + Test cct with object code initialization 3541657.9112 948983.7503 5201383.2482 2020.5000 Test cct with object name initialization -- cgit v1.2.3 From 0b4c8b0a76c65d8b1146224bf314cad53e9f6607 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 28 Nov 2020 15:51:27 +0100 Subject: cs2cs: add --area and --bbox options to restrict candidate coordinate operations (fixes #2423) --- test/cli/td_out.dist | 12 ++++++++++++ test/cli/testdatumfile | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'test/cli') diff --git a/test/cli/td_out.dist b/test/cli/td_out.dist index ab0c0911..6bad8e57 100644 --- a/test/cli/td_out.dist +++ b/test/cli/td_out.dist @@ -7,6 +7,18 @@ As above, but without ntv1 everything goes through conus file. 111d00'00.000"W 44d00'00.000"N 0.0 111d0'2.788"W 43d59'59.725"N 0.000 111d00'00.000"W 39d00'00.000"N 0.0 111d0'2.604"W 38d59'59.912"N 0.000 ############################################################## +Test --area Canada NAD27 NAD83 (using ntv1_can) +43d59'59.732"N 111d0'3.208"W 0.000 +* * inf +############################################################## +Test --bbox -141.01,40.04,-47.74,86.46 NAD27 NAD83 (using ntv1_can) +43d59'59.732"N 111d0'3.208"W 0.000 +* * inf +############################################################## +Test --area "USA - CONUS - onshore" NAD27 NAD83 (using conus) +43d59'59.725"N 111d0'2.788"W 0.000 +38d59'59.912"N 111d0'2.604"W 0.000 +############################################################## Test MD used where available 79d58'00.000"W 37d02'00.000"N 0.0 79d58'0.005"W 37d1'59.998"N 0.000 79d58'00.000"W 36d58'00.000"N 0.0 79d57'59.128"W 36d58'0.501"N 0.000 diff --git a/test/cli/testdatumfile b/test/cli/testdatumfile index 16e4bbc3..5a013f12 100755 --- a/test/cli/testdatumfile +++ b/test/cli/testdatumfile @@ -59,6 +59,27 @@ $EXE +proj=latlong +ellps=clrk66 '+nadgrids="./dir with "" space/myconus"' \ 111d00'00.000"W 39d00'00.000"N 0.0 EOF +echo "##############################################################" >> ${OUT} +echo "Test --area Canada NAD27 NAD83 (using ntv1_can)" >> ${OUT} +$EXE --area Canada NAD27 NAD83 >>${OUT} <> ${OUT} +echo "Test --bbox -141.01,40.04,-47.74,86.46 NAD27 NAD83 (using ntv1_can)" >> ${OUT} +$EXE --bbox -141.01,40.04,-47.74,86.46 NAD27 NAD83 >>${OUT} <> ${OUT} +echo "Test --area \"USA - CONUS - onshore\" NAD27 NAD83 (using conus)" >> ${OUT} +$EXE --area "USA - CONUS - onshore" NAD27 NAD83 >>${OUT} <> ${OUT} echo Test MD used where available >> ${OUT} # -- cgit v1.2.3 From f4dc79075c19706dda6e3253c2f224e9df468291 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 30 Nov 2020 01:35:59 +0100 Subject: API cleanup: unexport number of internal symbols, and remove/replace a few unused ones --- test/cli/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/cli') diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 4d11eaf3..46d9d36c 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -35,13 +35,13 @@ testprojinfo-check: PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTPROJINFO) $(PROJINFOEXE) test27-check: - $(TEST27) $(PROJEXE) + PROJ_LIB=$(PROJ_LIB) $(TEST27) $(PROJEXE) test83-check: - $(TEST83) $(PROJEXE) + PROJ_LIB=$(PROJ_LIB) $(TEST83) $(PROJEXE) testproj-check: - $(TESTPROJ) $(PROJEXE) + PROJ_LIB=$(PROJ_LIB) $(TESTPROJ) $(PROJEXE) testvarious-check: PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTVARIOUS) $(CS2CSEXE) -- cgit v1.2.3 From 18ab7ef2e357e0c01464848a6911e754ebca471f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 2 Dec 2020 17:12:54 +0100 Subject: cs2cs / proj_create_crs_to_crs_from_pj(): add a --authority switch to control where coordinate operations are looked for (fixes #2442) --- test/cli/testvarious | 13 +++++++++++++ test/cli/tv_out.dist | 7 +++++++ 2 files changed, 20 insertions(+) (limited to 'test/cli') diff --git a/test/cli/testvarious b/test/cli/testvarious index 292ee316..82be4992 100755 --- a/test/cli/testvarious +++ b/test/cli/testvarious @@ -1009,6 +1009,19 @@ $EXE -f %.3f EPSG:4686 EPSG:6247 -E >> ${OUT} <> ${OUT} +echo "Test effect of --authority (https://github.com/OSGeo/PROJ/issues/2442)" >> ${OUT} +echo "This test might be a bit fragile if proj.db content changes" >> ${OUT} +echo "The first result should use the 'WGS_1984_(ITRF08)_To_NAD_1983_2011' (ESRI:108363) operation" >> ${OUT} +echo "and the second one a no-op" >> ${OUT} +$EXE -E +proj=latlong +datum=WGS84 +no_defs +to +init=epsg:6342 >> ${OUT} <> ${OUT} <