Skip to content
Permalink
Browse files

Fix test

(cherry picked from commit 0f91c67)
  • Loading branch information
nyalldawson committed Jan 22, 2020
1 parent 7e71718 commit 3ef030e562eb4c634d199332fcc6dcfe09c98616
Showing with 10 additions and 3 deletions.
  1. +5 −3 src/core/qgscoordinatereferencesystem.cpp
  2. +5 −0 tests/src/core/testqgscoordinatereferencesystem.cpp
@@ -463,9 +463,11 @@ bool QgsCoordinateReferenceSystem::createFromOgcWmsCrs( const QString &crs )
if ( wmsCrs.compare( QLatin1String( "CRS:84" ), Qt::CaseInsensitive ) == 0 ||
wmsCrs.compare( QLatin1String( "OGC:CRS84" ), Qt::CaseInsensitive ) == 0 )
{
createFromOgcWmsCrs( QStringLiteral( "EPSG:4326" ) );
d->mAxisInverted = false;
d->mAxisInvertedDirty = false;
if ( loadFromDatabase( QgsApplication::srsDatabaseFilePath(), QStringLiteral( "lower(auth_name||':'||auth_id)" ), QStringLiteral( "epsg:4326" ) ) )
{
d->mAxisInverted = false;
d->mAxisInvertedDirty = false;
}

locker.changeMode( QgsReadWriteLocker::Write );
if ( !sDisableOgcCache )
@@ -1185,6 +1185,11 @@ void TestQgsCoordinateReferenceSystem::hasAxisInverted()

crs.createFromOgcWmsCrs( QStringLiteral( "CRS:84" ) ); // WGS 84 without inverted axes
QVERIFY( !crs.hasAxisInverted() );
QCOMPARE( crs.toWkt(), QStringLiteral( R"""(GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]])""" ) );

crs.createFromOgcWmsCrs( QStringLiteral( "OGC:CRS84" ) ); // WGS 84 without inverted axes
QVERIFY( !crs.hasAxisInverted() );
QCOMPARE( crs.toWkt(), QStringLiteral( R"""(GEOGCS["WGS 84 (CRS84)",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["OGC","CRS84"]])""" ) );

crs.createFromOgcWmsCrs( QStringLiteral( "EPSG:32633" ) ); // "WGS 84 / UTM zone 33N" - projected CRS without invertex axes
QVERIFY( !crs.hasAxisInverted() );

0 comments on commit 3ef030e

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