Skip to content

Commit

Permalink
createFromUserInput(): support URN:OGC:DEF:CRS:OGC:1.3:CRS84
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Apr 10, 2021
1 parent 5f3fda7 commit ea51372
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iso19111/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6626,9 +6626,9 @@ static BaseObjectNNPtr createFromUserInput(const std::string &text,
};

// urn:ogc:def:crs:EPSG::4326
if (tokens.size() == 7 && tokens[0] == "urn") {
if (tokens.size() == 7 && tolower(tokens[0]) == "urn") {

const auto &type = tokens[3];
const auto type = tokens[3] == "CRS" ? "crs" : tokens[3];
const auto &authName = tokens[4];
const auto &code = tokens[6];
return createFromURNPart(type, authName, code);
Expand Down
4 changes: 4 additions & 0 deletions test/unit/test_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10360,6 +10360,10 @@ TEST(io, createFromUserInput) {
EXPECT_NO_THROW(
createFromUserInput("urn:ogc:def:ellipsoid:EPSG::7030", dbContext));

// Found as srsName in some GMLs...
EXPECT_NO_THROW(
createFromUserInput("URN:OGC:DEF:CRS:OGC:1.3:CRS84", dbContext));

// Legacy formulations
EXPECT_NO_THROW(
createFromUserInput("urn:x-ogc:def:crs:EPSG::4326", dbContext));
Expand Down

0 comments on commit ea51372

Please sign in to comment.