diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-04-04 19:27:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-04 19:27:26 +0200 |
| commit | 0ff11909243616f4b8f58ae449e05685e59a73e4 (patch) | |
| tree | 66055fd783a6f9ae5d6bbca623849c7517a5d391 | |
| parent | 1f792e6b9c9b41c4da8f8996e3eb325e444b0099 (diff) | |
| parent | 335d9367fd07ebe5da50d2f9e336d5d8f6e31aee (diff) | |
| download | PROJ-0ff11909243616f4b8f58ae449e05685e59a73e4.tar.gz PROJ-0ff11909243616f4b8f58ae449e05685e59a73e4.zip | |
Merge pull request #2127 from rouault/projinfo_hide_ballpark
projinfo: add a --hide-ballpark option
| -rw-r--r-- | docs/source/apps/projinfo.rst | 32 | ||||
| -rw-r--r-- | docs/source/glossary.rst | 19 | ||||
| -rw-r--r-- | docs/source/operations/operations_computation.rst | 7 | ||||
| -rw-r--r-- | src/apps/projinfo.cpp | 14 | ||||
| -rwxr-xr-x | test/cli/testprojinfo | 4 | ||||
| -rw-r--r-- | test/cli/testprojinfo_out.dist | 5 |
6 files changed, 59 insertions, 22 deletions
diff --git a/docs/source/apps/projinfo.rst b/docs/source/apps/projinfo.rst index 0e54c244..99adbd50 100644 --- a/docs/source/apps/projinfo.rst +++ b/docs/source/apps/projinfo.rst @@ -20,8 +20,9 @@ Synopsis | [[--area name_or_code] | [--bbox west_long,south_lat,east_long,north_lat]] | [--spatial-test contains|intersects] | [--crs-extent-use none|both|intersection|smallest] - | [--grid-check none|discard_missing|sort|known_available] [--show-superseded] + | [--grid-check none|discard_missing|sort|known_available] | [--pivot-crs always|if_no_direct_transformation|never|{auth:code[,auth:code]*}] + | [--show-superseded] [--hide-ballpark] | [--boundcrs-to-wgs84] | [--main-db-path path] [--aux-db-path path]* | [--identify] [--3d] @@ -177,16 +178,6 @@ The following control parameters can appear in any order: .. note:: only used for coordinate operation computation -.. option:: -show-superseded - - When enabled, coordinate operations that are superseded by others will be - listed. Note that supersession is not equivalent to deprecation: superseded - operations are still considered valid although they have a better equivalent, - whereas deprecated operations have been determined to be erroneous and are - not considered at all. - - .. note:: only used for coordinate operation computation - .. option:: --pivot-crs always|if_no_direct_transformation|never|{auth:code[,auth:code]*} Determine if intermediate (pivot) CRS can be used when researching coordinate @@ -201,6 +192,25 @@ The following control parameters can appear in any order: .. note:: only used for coordinate operation computation +.. option:: --show-superseded + + When enabled, coordinate operations that are superseded by others will be + listed. Note that supersession is not equivalent to deprecation: superseded + operations are still considered valid although they have a better equivalent, + whereas deprecated operations have been determined to be erroneous and are + not considered at all. + + .. note:: only used for coordinate operation computation + +.. option:: --hide-ballpark + + .. versionadded:: 7.1 + + Hides any coordinate operation that is, or contains, a + :term:`Ballpark transformation` + + .. note:: only used for coordinate operation computation + .. option:: --boundcrs-to-wgs84 When specified, this option researches a coordinate operation from the diff --git a/docs/source/glossary.rst b/docs/source/glossary.rst index 21dd0f34..883460d4 100644 --- a/docs/source/glossary.rst +++ b/docs/source/glossary.rst @@ -6,6 +6,25 @@ Glossary .. glossary:: + Ballpark transformation + + For a transformation between two geographic CRS, a ballpark + transformation is a coordinate operation that only takes into account + potential difference of axis orders (long-lat vs lat-long), + units (degree vs grads) and prime meridian (Greewich vs Paris/Rome/other + historic prime meridians). It does not attempt any datum shift, hence + the "ballpark" qualifier in its name. Its accuracy is unknown, and could + lead in some cases to errors of a few hundreds of metres. + + For a transformation between two vertical CRS or a vertical CRS and + a geogrpahic CRS, a ballpark transformation only takes into account + potential different in units (e.g. metres vs feet). Its accuracy is + unknown, and could lead in some cases to errors of a few tens of metres. + + .. note:: + + The term "Ballpark transformation" is specific to PROJ. + Pseudocylindrical Projection Pseudocylindrical projections have the mathematical characteristics of diff --git a/docs/source/operations/operations_computation.rst b/docs/source/operations/operations_computation.rst index 1813a010..2836b75c 100644 --- a/docs/source/operations/operations_computation.rst +++ b/docs/source/operations/operations_computation.rst @@ -106,11 +106,8 @@ which can be used as an override). As those results all involve operations that does not have a perfect accuracy and that does not cover the area of use of the 2 CRSs, a -'Ballpark geographic offset from NAD27 to NAD83' operation is synthetized by PROJ. -This operation is a sort of dummy operation that only takes into account potential -difference of axis orders (long-lat vs lat-long), units (degree vs grads) and -prime meridian (Greewich vs Paris/Rome/other historic prime meridians). It does -not attempt any datum shift, hence the "ballpark" qualifier in its name. +'Ballpark geographic offset from NAD27 to NAD83' operation is synthetized by PROJ +(see :term:`Ballpark transformation`) Filtering and sorting of coordinate operations ---------------------------------------------- diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 1e58cfb0..10ce346f 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -71,6 +71,7 @@ struct OutputOptions { bool c_ify = false; bool singleLine = false; bool strict = true; + bool ballparkAllowed = true; }; } // anonymous namespace @@ -89,10 +90,10 @@ static void usage() { << std::endl << " [--grid-check " "none|discard_missing|sort|known_available] " - "[--show-superseded]" << std::endl << " [--pivot-crs always|if_no_direct_transformation|" << "never|{auth:code[,auth:code]*}]" << std::endl + << " [--show-superseded] [--hide-ballpark]" << std::endl << " [--boundcrs-to-wgs84]" << std::endl << " [--main-db-path path] [--aux-db-path path]*" << std::endl @@ -725,6 +726,15 @@ static void outputOperations( << std::endl; std::exit(1); } + if (!outputOpt.ballparkAllowed) { + std::vector<CoordinateOperationNNPtr> listNew; + for (const auto &op : list) { + if (!op->hasBallparkTransformation()) { + listNew.emplace_back(op); + } + } + list = std::move(listNew); + } if (outputOpt.quiet && !list.empty()) { outputObject(dbContext, list[0], allowUseIntermediateCRS, outputOpt); return; @@ -1053,6 +1063,8 @@ int main(int argc, char **argv) { showSuperseded = true; } else if (arg == "--lax") { outputOpt.strict = false; + } else if (arg == "--hide-ballpark") { + outputOpt.ballparkAllowed = false; } else if (ci_equal(arg, "--3d")) { promoteTo3D = true; } else if (ci_equal(arg, "--searchpaths")) { diff --git a/test/cli/testprojinfo b/test/cli/testprojinfo index 4ec1bdbb..df8cac8c 100755 --- a/test/cli/testprojinfo +++ b/test/cli/testprojinfo @@ -58,8 +58,8 @@ echo "Testing projinfo -s NAD27 -t NAD83" >> ${OUT} $EXE -s NAD27 -t NAD83 >>${OUT} echo "" >>${OUT} -echo "Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary" >> ${OUT} -$EXE -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary >>${OUT} +echo "Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary --hide-ballpark" >> ${OUT} +$EXE -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary --hide-ballpark >>${OUT} echo "" >>${OUT} echo "Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects" >> ${OUT} diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index 99fae293..17390534 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -266,8 +266,8 @@ COORDINATEOPERATION["Ballpark geographic offset from NAD27 to NAD83", AREA["World"], BBOX[-90,-180,90,180]]] -Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary -Candidate operations found: 10 +Testing projinfo -s NAD27 -t NAD83 --grid-check none --spatial-test intersects --summary --hide-ballpark +Candidate operations found: 9 DERIVED_FROM(EPSG):1312, NAD27 to NAD83 (3), 2.0 m, Canada DERIVED_FROM(EPSG):1313, NAD27 to NAD83 (4), 1.5 m, Canada - NAD27 DERIVED_FROM(EPSG):1241, NAD27 to NAD83 (1), 0.15 m, USA - CONUS including EEZ @@ -275,7 +275,6 @@ DERIVED_FROM(EPSG):1243, NAD27 to NAD83 (2), 0.5 m, USA - Alaska including EEZ DERIVED_FROM(EPSG):1573, NAD27 to NAD83 (6), 1.5 m, Canada - Quebec EPSG:1462, NAD27 to NAD83 (5), 2.0 m, Canada - Quebec EPSG:9111, NAD27 to NAD83 (9), 1.5 m, Canada - Saskatchewan -unknown id, Ballpark geographic offset from NAD27 to NAD83, unknown accuracy, World, has ballpark transformation EPSG:8555, NAD27 to NAD83 (7), 0.15 m, USA - CONUS and GoM EPSG:8549, NAD27 to NAD83 (8), 0.5 m, USA - Alaska |
