Skip to content
Permalink
Browse files

[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 Oct 14, 2019
1 parent d7144ea commit fda35a1e6ee69631bc992dea774c1dd3727d01e0
@@ -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 ) )
{
@@ -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()

0 comments on commit fda35a1

Please sign in to comment.
You can’t perform that action at this time.