aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/io.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-22 19:34:23 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-10-22 19:34:23 +0200
commit698e51f476772ebfdd8ba7b93c5a5beafcb90f64 (patch)
treea60a1212cc22623a4206b22ffe751cff7f4ce39d /src/iso19111/io.cpp
parent4fa0c250c125b8b034e0a17d2d03909dafdb6813 (diff)
downloadPROJ-698e51f476772ebfdd8ba7b93c5a5beafcb90f64.tar.gz
PROJ-698e51f476772ebfdd8ba7b93c5a5beafcb90f64.zip
WKT parser: accept implicit compoundCRS from ESRI WKT, like "PROJCS[...],VERTCS[...]"
Diffstat (limited to 'src/iso19111/io.cpp')
-rw-r--r--src/iso19111/io.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index 0f4ffba0..503b6be5 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -6507,6 +6507,33 @@ BaseObjectNNPtr WKTParser::createFromWKT(const std::string &wkt) {
}
return d->buildGeodeticReferenceFrame(root, primeMeridian,
null_node);
+ } else if (ci_equal(name, WKTConstants::GEOGCS) ||
+ ci_equal(name, WKTConstants::PROJCS)) {
+ // Parse implicit compoundCRS from ESRI that is
+ // "PROJCS[...],VERTCS[...]" or "GEOGCS[...],VERTCS[...]"
+ if (indexEnd < wkt.size()) {
+ indexEnd = skipSpace(wkt, indexEnd);
+ if (indexEnd < wkt.size() && wkt[indexEnd] == ',') {
+ ++indexEnd;
+ indexEnd = skipSpace(wkt, indexEnd);
+ if (indexEnd < wkt.size() &&
+ ci_starts_with(wkt.c_str() + indexEnd,
+ WKTConstants::VERTCS.c_str())) {
+ auto horizCRS = d->buildCRS(root);
+ if (horizCRS) {
+ auto vertCRS =
+ d->buildVerticalCRS(WKTNode::createFrom(
+ wkt, indexEnd, 0, indexEnd));
+ return CompoundCRS::create(
+ util::PropertyMap().set(
+ IdentifiedObject::NAME_KEY,
+ horizCRS->nameStr() + " + " +
+ vertCRS->nameStr()),
+ {NN_NO_CHECK(horizCRS), vertCRS});
+ }
+ }
+ }
+ }
}
return d->build(root);
};