aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/io.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2019-01-09 16:24:16 +0100
committerGitHub <noreply@github.com>2019-01-09 16:24:16 +0100
commit5b75e5fdccc531f7b0e3dcd636fa1ff3500bb071 (patch)
treec718433341207fa688e85e145cf83ac4149491ab /src/iso19111/io.cpp
parent11bc4783ca2c5fed8603d0c49f5aea102eca2432 (diff)
parenta6899c98a6455dc022bdd6785af3e528488422b8 (diff)
downloadPROJ-5b75e5fdccc531f7b0e3dcd636fa1ff3500bb071.tar.gz
PROJ-5b75e5fdccc531f7b0e3dcd636fa1ff3500bb071.zip
Merge pull request #1217 from rouault/remove_proj_5_crs_export
ISO19111: remove PROJ.5 specific format for CRS (refs #1214)
Diffstat (limited to 'src/iso19111/io.cpp')
-rw-r--r--src/iso19111/io.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index cfccd70f..13a8f236 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -4596,15 +4596,19 @@ IPROJStringExportable::~IPROJStringExportable() = default;
std::string IPROJStringExportable::exportToPROJString(
PROJStringFormatter *formatter) const {
+ const bool bIsCRS = dynamic_cast<const crs::CRS *>(this) != nullptr;
+ if (bIsCRS) {
+ formatter->setCRSExport(true);
+ }
_exportToPROJString(formatter);
- if (formatter->getAddNoDefs() &&
- formatter->convention() ==
- io::PROJStringFormatter::Convention::PROJ_4 &&
- dynamic_cast<const crs::CRS *>(this)) {
+ if (formatter->getAddNoDefs() && bIsCRS) {
if (!formatter->hasParam("no_defs")) {
formatter->addParam("no_defs");
}
}
+ if (bIsCRS) {
+ formatter->setCRSExport(false);
+ }
return formatter->toString();
}
//! @endcond
@@ -4673,6 +4677,7 @@ struct PROJStringFormatter::Private {
bool useETMercForTMercSet_ = false;
bool addNoDefs_ = true;
bool coordOperationOptimizations_ = false;
+ bool crsExport_ = false;
std::string result_{};
@@ -5311,6 +5316,14 @@ void PROJStringFormatter::ingestPROJString(
// ---------------------------------------------------------------------------
+void PROJStringFormatter::setCRSExport(bool b) { d->crsExport_ = b; }
+
+// ---------------------------------------------------------------------------
+
+bool PROJStringFormatter::getCRSExport() const { return d->crsExport_; }
+
+// ---------------------------------------------------------------------------
+
void PROJStringFormatter::startInversion() {
PROJStringFormatter::Private::InversionStackElt elt;
elt.startIter = d->steps_.end();