Skip to content
Permalink
Browse files

Fix test

  • Loading branch information
nyalldawson committed Jan 22, 2020
1 parent 076fe2b commit 5a6963e8b00998a4e4c9c288427b127c3aab7a7b
Showing with 10 additions and 3 deletions.
  1. +5 −3 src/core/qgscoordinatereferencesystem.cpp
  2. +5 −0 tests/src/core/testqgscoordinatereferencesystem.cpp
@@ -466,9 +466,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 5a6963e

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