@@ -238,9 +238,12 @@ bool QgsCoordinateReferenceSystem::createFromOgcWmsCrs( const QString& theCrs )
238
238
if ( wmsCrs.compare ( " CRS:84" , Qt::CaseInsensitive ) == 0 ||
239
239
wmsCrs.compare ( " OGC:CRS84" , Qt::CaseInsensitive ) == 0 )
240
240
{
241
- d.detach ();
242
241
createFromOgcWmsCrs ( " EPSG:4326" );
243
- d->mAxisInverted = 0 ;
242
+
243
+ d.detach ();
244
+ d->mAxisInverted = false ;
245
+ d->mAxisInvertedDirty = false ;
246
+
244
247
return d->mIsValid ;
245
248
}
246
249
@@ -337,7 +340,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( const QString& db, const QString&
337
340
d->mSRID = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 5 ) ) ).toLong () ;
338
341
d->mAuthId = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 6 ) ) );
339
342
d->mIsGeographic = QString::fromUtf8 ( reinterpret_cast < const char * >( sqlite3_column_text ( myPreparedStatement, 7 ) ) ).toInt () != 0 ;
340
- d->mAxisInverted = - 1 ;
343
+ d->mAxisInvertedDirty = true ;
341
344
342
345
if ( d->mSrsId >= USER_CRS_START_ID && d->mAuthId .isEmpty () )
343
346
{
@@ -367,7 +370,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( const QString& db, const QString&
367
370
368
371
bool QgsCoordinateReferenceSystem::axisInverted () const
369
372
{
370
- if ( d->mAxisInverted == - 1 )
373
+ if ( d->mAxisInvertedDirty )
371
374
{
372
375
OGRAxisOrientation orientation;
373
376
OSRGetAxis ( d->mCRS , OSRIsGeographic ( d->mCRS ) ? " GEOGCS" : " PROJCS" , 0 , &orientation );
@@ -386,9 +389,10 @@ bool QgsCoordinateReferenceSystem::axisInverted() const
386
389
}
387
390
388
391
d->mAxisInverted = orientation == OAO_North;
392
+ d->mAxisInvertedDirty = false ;
389
393
}
390
394
391
- return d->mAxisInverted != 0 ;
395
+ return d->mAxisInverted ;
392
396
}
393
397
394
398
bool QgsCoordinateReferenceSystem::createFromWkt ( const QString &theWkt )
0 commit comments