File tree Expand file tree Collapse file tree 1 file changed +23
-12
lines changed Expand file tree Collapse file tree 1 file changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -1051,27 +1051,38 @@ bool QgsCoordinateReferenceSystem::readXML( QDomNode & theNode )
1051
1051
{
1052
1052
bool initialized = false ;
1053
1053
1054
- QDomNode myNode = srsNode.namedItem ( " authid" );
1055
- if ( !myNode.isNull () )
1056
- {
1057
- operator =( QgsCRSCache::instance ()->crsByAuthId ( myNode.toElement ().text () ) );
1058
- if ( isValid () )
1059
- {
1060
- initialized = true ;
1061
- }
1062
- }
1054
+ long srsid = srsNode.namedItem ( " srsid" ).toElement ().text ().toLong ();
1063
1055
1064
- if ( !initialized )
1056
+ QDomNode myNode;
1057
+
1058
+ if ( srsid < USER_CRS_START_ID )
1065
1059
{
1066
- myNode = srsNode.namedItem ( " epsg " );
1060
+ myNode = srsNode.namedItem ( " authid " );
1067
1061
if ( !myNode.isNull () )
1068
1062
{
1069
- operator =( QgsCRSCache::instance ()->crsByEpsgId ( myNode.toElement ().text (). toLong () ) );
1063
+ operator =( QgsCRSCache::instance ()->crsByAuthId ( myNode.toElement ().text () ) );
1070
1064
if ( isValid () )
1071
1065
{
1072
1066
initialized = true ;
1073
1067
}
1074
1068
}
1069
+
1070
+ if ( !initialized )
1071
+ {
1072
+ myNode = srsNode.namedItem ( " epsg" );
1073
+ if ( !myNode.isNull () )
1074
+ {
1075
+ operator =( QgsCRSCache::instance ()->crsByEpsgId ( myNode.toElement ().text ().toLong () ) );
1076
+ if ( isValid () )
1077
+ {
1078
+ initialized = true ;
1079
+ }
1080
+ }
1081
+ }
1082
+ }
1083
+ else
1084
+ {
1085
+ QgsDebugMsg ( " Ignoring authid/epsg for user crs." );
1075
1086
}
1076
1087
1077
1088
if ( initialized )
You can’t perform that action at this time.
0 commit comments