From c99cfa8ee743251faba9bc04ee5cf5a6010359eb Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 1 Jul 2020 14:14:24 +0200 Subject: 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 --- src/iso19111/io.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/iso19111/io.cpp') 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) { -- cgit v1.2.3