Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix Blocker issue 8487
Custom CRS are saved if cannot find an existing one with same parameters
(except datum which may be optionnal, as GDAL seems to have drop it)
- Loading branch information
Showing
with
21 additions
and
2 deletions.
-
+21
−2
src/core/qgscoordinatereferencesystem.cpp
|
@@ -593,6 +593,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String |
|
|
} |
|
|
} |
|
|
|
|
|
QStringList myParam; |
|
|
if ( myRecord.empty() ) |
|
|
{ |
|
|
// match all parameters individually: |
|
@@ -618,6 +619,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String |
|
|
{ |
|
|
sql += delim + arg; |
|
|
delim = " AND "; |
|
|
myParam.append(param); |
|
|
} |
|
|
} |
|
|
|
|
@@ -637,9 +639,26 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String |
|
|
{ |
|
|
mySrsId = myRecord["srs_id"].toLong(); |
|
|
QgsDebugMsg( "proj4string param match search for srsid returned srsid: " + QString::number( mySrsId ) ); |
|
|
if ( mySrsId > 0 ) |
|
|
// Bugfix 8487 : test param lists are equal, except for +datum |
|
|
myParam.sort(); |
|
|
QStringList foundParam; |
|
|
foreach ( QString paramfound, myRecord["parameters"].split( QRegExp( "\\s+(?=\\+)" ), QString::SkipEmptyParts ) ) |
|
|
{ |
|
|
createFromSrsId( mySrsId ); |
|
|
if ( !paramfound.startsWith( "+datum=" ) ) |
|
|
foundParam.append(paramfound); |
|
|
} |
|
|
foundParam.sort(); |
|
|
if ( myParam == foundParam) |
|
|
{ |
|
|
if ( mySrsId > 0 ) |
|
|
{ |
|
|
createFromSrsId( mySrsId ); |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
// Params differ |
|
|
mIsValidFlag = false; |
|
|
} |
|
|
} |
|
|
else |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.