@@ -317,9 +317,11 @@ bool QgsCoordinateReferenceSystem::createFromOgcWmsCrs( const QString& theCrs )
317
317
if ( wmsCrs.compare ( " CRS:84" , Qt::CaseInsensitive ) == 0 ||
318
318
wmsCrs.compare ( " OGC:CRS84" , Qt::CaseInsensitive ) == 0 )
319
319
{
320
- d.detach ();
321
320
createFromOgcWmsCrs ( " EPSG:4326" );
322
- d->mAxisInverted = 0 ;
321
+
322
+ d.detach ();
323
+ d->mAxisInverted = false ;
324
+ d->mAxisInvertedDirty = false ;
323
325
324
326
mOgcLock .lockForWrite ();
325
327
mOgcCache .insert ( theCrs, *this );
@@ -458,7 +460,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( const QString& db, const QString&
458
460
d->mSRID = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 5 ) ) ).toLong () ;
459
461
d->mAuthId = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 6 ) ) );
460
462
d->mIsGeographic = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 7 ) ) ).toInt () != 0 ;
461
- d->mAxisInverted = - 1 ;
463
+ d->mAxisInvertedDirty = true ;
462
464
463
465
if ( d->mSrsId >= USER_CRS_START_ID && d->mAuthId .isEmpty () )
464
466
{
@@ -488,7 +490,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( const QString& db, const QString&
488
490
489
491
bool QgsCoordinateReferenceSystem::hasAxisInverted () const
490
492
{
491
- if ( d->mAxisInverted == - 1 )
493
+ if ( d->mAxisInvertedDirty )
492
494
{
493
495
OGRAxisOrientation orientation;
494
496
OSRGetAxis ( d->mCRS , OSRIsGeographic ( d->mCRS ) ? " GEOGCS" : " PROJCS" , 0 , &orientation );
@@ -507,9 +509,10 @@ bool QgsCoordinateReferenceSystem::hasAxisInverted() const
507
509
}
508
510
509
511
d->mAxisInverted = orientation == OAO_North;
512
+ d->mAxisInvertedDirty = false ;
510
513
}
511
514
512
- return d->mAxisInverted != 0 ;
515
+ return d->mAxisInverted ;
513
516
}
514
517
515
518
bool QgsCoordinateReferenceSystem::createFromWkt ( const QString &theWkt )
0 commit comments