aboutsummaryrefslogtreecommitdiff
path: root/src/apps
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-01-08 16:22:15 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-01-08 21:25:07 +0100
commitf5e5435fd5071d550e0d13f7a5d71e09c1fab2c0 (patch)
treef569d5270f7cb34adf056d04c84a23db6b4f6ed0 /src/apps
parentfdee4277efb45b07db2dcc4d93376cbd01cfbd0a (diff)
downloadPROJ-f5e5435fd5071d550e0d13f7a5d71e09c1fab2c0.tar.gz
PROJ-f5e5435fd5071d550e0d13f7a5d71e09c1fab2c0.zip
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...
Diffstat (limited to 'src/apps')
-rw-r--r--src/apps/projinfo.cpp35
1 files changed, 4 insertions, 31 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp
index b418bc57..0540a0f9 100644
--- a/src/apps/projinfo.cpp
+++ b/src/apps/projinfo.cpp
@@ -61,7 +61,6 @@ namespace { // anonymous namespace
struct OutputOptions {
bool quiet = false;
bool PROJ5 = false;
- bool PROJ4 = false;
bool WKT2_2018 = false;
bool WKT2_2018_SIMPLIFIED = false;
bool WKT2_2015 = false;
@@ -100,7 +99,7 @@ static void usage() {
<< std::endl;
std::cerr << std::endl;
std::cerr << "-o: formats is a comma separated combination of: "
- "all,default,PROJ4,PROJ,WKT_ALL,WKT2_2015,WKT2_2018,WKT1_GDAL,"
+ "all,default,PROJ,WKT_ALL,WKT2_2015,WKT2_2018,WKT1_GDAL,"
"WKT1_ESRI"
<< std::endl;
std::cerr << " Except 'all' and 'default', other format can be preceded "
@@ -256,29 +255,11 @@ static void outputObject(DatabaseContextPtr dbContext, BaseObjectNNPtr obj,
if (projStringExportable) {
if (outputOpt.PROJ5) {
try {
- if (!outputOpt.quiet) {
- std::cout << "PROJ string:" << std::endl;
- }
- std::cout << projStringExportable->exportToPROJString(
- PROJStringFormatter::create(
- PROJStringFormatter::Convention::PROJ_5,
- dbContext)
- .get())
- << std::endl;
- } catch (const std::exception &e) {
- std::cerr << "Error when exporting to PROJ string: " << e.what()
- << std::endl;
- }
- alreadyOutputed = true;
- }
-
- if (outputOpt.PROJ4) {
- try {
if (alreadyOutputed) {
std::cout << std::endl;
}
if (!outputOpt.quiet) {
- std::cout << "PROJ.4 string:" << std::endl;
+ std::cout << "PROJ string:" << std::endl;
}
auto crs = nn_dynamic_pointer_cast<CRS>(obj);
@@ -295,7 +276,7 @@ static void outputObject(DatabaseContextPtr dbContext, BaseObjectNNPtr obj,
std::cout << objToExport->exportToPROJString(
PROJStringFormatter::create(
- PROJStringFormatter::Convention::PROJ_4,
+ PROJStringFormatter::Convention::PROJ_5,
dbContext)
.get())
<< std::endl;
@@ -651,23 +632,15 @@ int main(int argc, char **argv) {
for (auto format : formats) {
if (ci_equal(format, "all")) {
outputOpt.PROJ5 = true;
- outputOpt.PROJ4 = true;
outputOpt.WKT2_2018 = true;
outputOpt.WKT2_2015 = true;
outputOpt.WKT1_GDAL = true;
outputOpt.WKT1_ESRI = true;
} else if (ci_equal(format, "default")) {
outputOpt.PROJ5 = true;
- outputOpt.PROJ4 = false;
outputOpt.WKT2_2018 = false;
outputOpt.WKT2_2015 = true;
outputOpt.WKT1_GDAL = false;
- } else if (ci_equal(format, "PROJ4") ||
- ci_equal(format, "PROJ.4")) {
- outputOpt.PROJ4 = true;
- } else if (ci_equal(format, "-PROJ4") ||
- ci_equal(format, "-PROJ.4")) {
- outputOpt.PROJ4 = false;
} else if (ci_equal(format, "PROJ")) {
outputOpt.PROJ5 = true;
} else if (ci_equal(format, "-PROJ")) {
@@ -929,7 +902,7 @@ int main(int argc, char **argv) {
}
if (outputOpt.quiet &&
- (outputOpt.PROJ5 + outputOpt.PROJ4 + outputOpt.WKT2_2018 +
+ (outputOpt.PROJ5 + outputOpt.WKT2_2018 +
outputOpt.WKT2_2015 + outputOpt.WKT1_GDAL) != 1) {
std::cerr << "-q can only be used with a single output format"
<< std::endl;