Skip to content

Commit 195a2fb

Browse files
committed
Workaround ellipsoid_acronym not null constraint
1 parent af79577 commit 195a2fb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/qgscoordinatereferencesystem.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,15 @@ int QgsCoordinateReferenceSystem::syncDatabase()
19811981
{
19821982
ellps = ellipseRegExp.cap( 1 );
19831983
}
1984+
else
1985+
{
1986+
// satisfy not null constraint on ellipsoid_acronym field
1987+
// possibly we should drop the constraint, yet the crses with missing ellipsoid_acronym are malformed
1988+
// and will result in oddities within other areas of QGIS (e.g. project ellipsoid won't be correctly
1989+
// set for these CRSes). Better just hack around and make the constraint happy for now,
1990+
// and hope that the definitions get corrected in future.
1991+
ellps = "";
1992+
}
19841993

19851994
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)" )
19861995
.arg( QgsSqliteUtils::quotedString( name ),

0 commit comments

Comments
 (0)