Skip to content

Commit

Permalink
Workaround ellipsoid_acronym not null constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 7, 2018
1 parent af79577 commit 195a2fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -1981,6 +1981,15 @@ int QgsCoordinateReferenceSystem::syncDatabase()
{
ellps = ellipseRegExp.cap( 1 );
}
else
{
// satisfy not null constraint on ellipsoid_acronym field
// possibly we should drop the constraint, yet the crses with missing ellipsoid_acronym are malformed
// and will result in oddities within other areas of QGIS (e.g. project ellipsoid won't be correctly
// set for these CRSes). Better just hack around and make the constraint happy for now,
// and hope that the definitions get corrected in future.
ellps = "";
}

sql = QStringLiteral( "INSERT INTO tbl_srs(description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) VALUES (%1,%2,%3,%4,%5,'EPSG',%5,%6,%7)" )
.arg( QgsSqliteUtils::quotedString( name ),
Expand Down

0 comments on commit 195a2fb

Please sign in to comment.