Skip to content

Commit

Permalink
Don't try to identify CRSes created just for ellipsoid definitions
Browse files Browse the repository at this point in the history
These don't correspond to standard CRSes, and by avoiding the identification
we shave a considerable time off QGIS startup (about 1/3rd on my machine!)
  • Loading branch information
nyalldawson committed May 19, 2020
1 parent 0acb7fc commit 15b318b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsellipsoidutils.cpp
Expand Up @@ -405,11 +405,11 @@ QList<QgsEllipsoidUtils::EllipsoidDefinition> QgsEllipsoidUtils::definitions()
def.parameters.semiMinor = semiMinor;
def.parameters.inverseFlattening = invFlattening;
if ( !semiMinorComputed )
def.parameters.crs = QgsCoordinateReferenceSystem::fromProj( QStringLiteral( "+proj=longlat +a=%1 +b=%2 +no_defs +type=crs" ).arg( def.parameters.semiMajor, 0, 'g', 17 ).arg( def.parameters.semiMinor, 0, 'g', 17 ) );
def.parameters.crs.createFromProj( QStringLiteral( "+proj=longlat +a=%1 +b=%2 +no_defs +type=crs" ).arg( def.parameters.semiMajor, 0, 'g', 17 ).arg( def.parameters.semiMinor, 0, 'g', 17 ), false );
else if ( !qgsDoubleNear( def.parameters.inverseFlattening, 0.0 ) )
def.parameters.crs = QgsCoordinateReferenceSystem::fromProj( QStringLiteral( "+proj=longlat +a=%1 +rf=%2 +no_defs +type=crs" ).arg( def.parameters.semiMajor, 0, 'g', 17 ).arg( def.parameters.inverseFlattening, 0, 'g', 17 ) );
def.parameters.crs.createFromProj( QStringLiteral( "+proj=longlat +a=%1 +rf=%2 +no_defs +type=crs" ).arg( def.parameters.semiMajor, 0, 'g', 17 ).arg( def.parameters.inverseFlattening, 0, 'g', 17 ), false );
else
def.parameters.crs = QgsCoordinateReferenceSystem::fromProj( QStringLiteral( "+proj=longlat +a=%1 +no_defs +type=crs" ).arg( def.parameters.semiMajor, 0, 'g', 17 ) );
def.parameters.crs.createFromProj( QStringLiteral( "+proj=longlat +a=%1 +no_defs +type=crs" ).arg( def.parameters.semiMajor, 0, 'g', 17 ), false );
}
else
{
Expand Down

0 comments on commit 15b318b

Please sign in to comment.