diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/io.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index 2d31fd59..ffd78653 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -6485,7 +6485,7 @@ static BaseObjectNNPtr createFromUserInput(const std::string &text, } // urn:ogc:def:crs:EPSG::4326 - if (tokens.size() == 7) { + if (tokens.size() == 7 && tokens[0] == "urn") { if (!dbContext) { throw ParsingException("no database context specified"); } @@ -6514,6 +6514,22 @@ static BaseObjectNNPtr createFromUserInput(const std::string &text, throw ParsingException(concat("unhandled object type: ", type)); } + // Legacy urn:opengis:crs:EPSG:0:4326 (note the missing def: compared to + // above) + if (tokens.size() == 6 && tokens[0] == "urn") { + if (!dbContext) { + throw ParsingException("no database context specified"); + } + const auto &type = tokens[2]; + auto factory = + AuthorityFactory::create(NN_NO_CHECK(dbContext), tokens[3]); + const auto &code = tokens[5]; + if (type == "crs") { + return factory->createCoordinateReferenceSystem(code); + } + throw ParsingException(concat("unhandled object type: ", type)); + } + if (dbContext) { auto factory = AuthorityFactory::create(NN_NO_CHECK(dbContext), std::string()); |
