Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BUGFIX] QgsCoordinateReferenceSystem::createFromOgcWmsCrs(): fix imp…
…orting http://www.opengis.net/def/crs/OGC/1.3/CRS84

(cherry picked from commit d257595)
(cherry picked from commit a90e6b95cad4ce383698f69fcc6a69974b0d3139)
  • Loading branch information
rouault authored and nyalldawson committed Dec 16, 2019
1 parent d7144ea commit fda35a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -388,7 +388,7 @@ bool QgsCoordinateReferenceSystem::createFromOgcWmsCrs( const QString &crs )

QString wmsCrs = crs;

QRegExp re_uri( "http://www\\.opengis\\.net/def/crs/([^/]+).+/(\\d+)", Qt::CaseInsensitive );
QRegExp re_uri( "http://www\\.opengis\\.net/def/crs/([^/]+).+/([^/]+)", Qt::CaseInsensitive );
QRegExp re_urn( "urn:ogc:def:crs:([^:]+).+([^:]+)", Qt::CaseInsensitive );
if ( re_uri.exactMatch( wmsCrs ) )
{
Expand Down
7 changes: 7 additions & 0 deletions tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -255,6 +255,13 @@ void TestQgsCoordinateReferenceSystem::createFromOgcWmsCrs()

myCrs.createFromOgcWmsCrs( QStringLiteral( "i am not a CRS" ) );
QVERIFY( !myCrs.isValid() );

myCrs.createFromOgcWmsCrs( QStringLiteral( "http://www.opengis.net/def/crs/OGC/1.3/CRS84" ) );
QVERIFY( myCrs.isValid() );
QVERIFY( !myCrs.hasAxisInverted() );
#if PROJ_VERSION_MAJOR>=6
QCOMPARE( myCrs.authid(), QString( "OGC:CRS84" ) );
#endif
}

void TestQgsCoordinateReferenceSystem::fromOgcWmsCrs()
Expand Down

0 comments on commit fda35a1

Please sign in to comment.