aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/io.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-07-01 14:14:24 +0200
committerGitHub <noreply@github.com>2020-07-01 14:14:24 +0200
commitc99cfa8ee743251faba9bc04ee5cf5a6010359eb (patch)
tree6043af1187f971fa1af9aa7a064b43be18bfc22e /src/iso19111/io.cpp
parent42cd77130675504b6a1db5b128b41c8d5df19f9d (diff)
downloadPROJ-c99cfa8ee743251faba9bc04ee5cf5a6010359eb.tar.gz
PROJ-c99cfa8ee743251faba9bc04ee5cf5a6010359eb.zip
WKT parser: do not raise warning when parsing a WKT2:2015 TIMECRS whose TIMEUNIT is at the CS level, and not inside (#2276)
Adresses testTemporal() and testCompoundWithTime() cases of https://github.com/OSGeo/PROJ/issues/2275#issuecomment-650765730
Diffstat (limited to 'src/iso19111/io.cpp')
-rw-r--r--src/iso19111/io.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index 38b407ee..5493684d 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -2642,10 +2642,15 @@ WKTParser::Private::buildCS(const WKTNodeNNPtr &node, /* maybe null */
}
} else if (ci_equal(csType, "temporal")) { // WKT2-2015
if (axisCount == 1) {
- return DateTimeTemporalCS::create(
- csMap,
- axisList[0]); // FIXME: there are 3 possible subtypes of
- // TemporalCS
+ if (isNull(
+ parentNode->GP()->lookForChild(WKTConstants::TIMEUNIT)) &&
+ isNull(parentNode->GP()->lookForChild(WKTConstants::UNIT))) {
+ return DateTimeTemporalCS::create(csMap, axisList[0]);
+ } else {
+ // Default to TemporalMeasureCS
+ // TemporalCount could also be possible
+ return TemporalMeasureCS::create(csMap, axisList[0]);
+ }
}
} else if (ci_equal(csType, "TemporalDateTime")) { // WKT2-2019
if (axisCount == 1) {