File tree 1 file changed +23
-12
lines changed
1 file changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -1078,27 +1078,38 @@ bool QgsCoordinateReferenceSystem::readXML( QDomNode & theNode )
1078
1078
{
1079
1079
bool initialized = false ;
1080
1080
1081
- QDomNode myNode = srsNode.namedItem ( " authid" );
1082
- if ( !myNode.isNull () )
1083
- {
1084
- operator =( QgsCRSCache::instance ()->crsByAuthId ( myNode.toElement ().text () ) );
1085
- if ( isValid () )
1086
- {
1087
- initialized = true ;
1088
- }
1089
- }
1081
+ long srsid = srsNode.namedItem ( " srsid" ).toElement ().text ().toLong ();
1090
1082
1091
- if ( !initialized )
1083
+ QDomNode myNode;
1084
+
1085
+ if ( srsid < USER_CRS_START_ID )
1092
1086
{
1093
- myNode = srsNode.namedItem ( " epsg " );
1087
+ myNode = srsNode.namedItem ( " authid " );
1094
1088
if ( !myNode.isNull () )
1095
1089
{
1096
- operator =( QgsCRSCache::instance ()->crsByEpsgId ( myNode.toElement ().text (). toLong () ) );
1090
+ operator =( QgsCRSCache::instance ()->crsByAuthId ( myNode.toElement ().text () ) );
1097
1091
if ( isValid () )
1098
1092
{
1099
1093
initialized = true ;
1100
1094
}
1101
1095
}
1096
+
1097
+ if ( !initialized )
1098
+ {
1099
+ myNode = srsNode.namedItem ( " epsg" );
1100
+ if ( !myNode.isNull () )
1101
+ {
1102
+ operator =( QgsCRSCache::instance ()->crsByEpsgId ( myNode.toElement ().text ().toLong () ) );
1103
+ if ( isValid () )
1104
+ {
1105
+ initialized = true ;
1106
+ }
1107
+ }
1108
+ }
1109
+ }
1110
+ else
1111
+ {
1112
+ QgsDebugMsg ( " Ignoring authid/epsg for user crs." );
1102
1113
}
1103
1114
1104
1115
if ( initialized )
You can’t perform that action at this time.
0 commit comments