File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1714,6 +1714,8 @@ long QgsCoordinateReferenceSystem::saveAsUserCrs( const QString &name )
1714
1714
}
1715
1715
else
1716
1716
returnId = -1 ;
1717
+
1718
+ invalidateCache ();
1717
1719
return returnId;
1718
1720
}
1719
1721
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ void TestQgsCoordinateReferenceSystem::initTestCase()
106
106
//
107
107
// init QGIS's paths - true means that all path will be inited from prefix
108
108
QgsApplication::init ( mTempFolder );
109
+ QgsApplication::createDatabase ();
109
110
QgsApplication::initQgis ();
110
111
QgsApplication::showSettings ();
111
112
@@ -820,6 +821,13 @@ void TestQgsCoordinateReferenceSystem::saveAsUserCrs()
820
821
821
822
long newId = userCrs.saveAsUserCrs ( QStringLiteral ( " babies first projection" ) );
822
823
QCOMPARE ( newId, static_cast < long >( USER_CRS_START_ID ) );
824
+ QCOMPARE ( userCrs.srsid (), newId );
825
+
826
+ // new CRS with same definition, check that it's matched to user crs
827
+ QgsCoordinateReferenceSystem userCrs2 = QgsCoordinateReferenceSystem::fromProj4 ( madeUpProjection );
828
+ QVERIFY ( userCrs2.isValid () );
829
+ QCOMPARE ( userCrs2.toProj4 (), madeUpProjection );
830
+ QCOMPARE ( userCrs2.srsid (), userCrs.srsid () );
823
831
}
824
832
825
833
QGSTEST_MAIN ( TestQgsCoordinateReferenceSystem )
You can’t perform that action at this time.
0 commit comments