Skip to content

Commit 7805af3

Browse files
committed
crssync: exclude some records from updates from GDAL
sqlite3 resources/srs.db sqlite> alter table tbl_srs add noupdate boolean; sqlite> update tbl_srs set noupdate=(auth_name='EPSG' and auth_id in (5513,5514,5221,2065,102067,4156,4818));
1 parent 3f9890f commit 7805af3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

resources/srs.db

15 KB
Binary file not shown.

src/core/qgscoordinatereferencesystem.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ int QgsCoordinateReferenceSystem::syncDb()
17101710
continue;
17111711
}
17121712

1713-
sql = QString( "SELECT parameters FROM tbl_srs WHERE auth_name='EPSG' AND auth_id='%1'" ).arg( it.key() );
1713+
sql = QString( "SELECT parameters,noupdate FROM tbl_srs WHERE auth_name='EPSG' AND auth_id='%1'" ).arg( it.key() );
17141714
if ( sqlite3_prepare( database, sql.toAscii(), sql.size(), &select, &tail ) != SQLITE_OK )
17151715
{
17161716
qCritical( "Could not prepare: %s [%s]\n", sql.toAscii().constData(), sqlite3_errmsg( database ) );
@@ -1721,6 +1721,9 @@ int QgsCoordinateReferenceSystem::syncDb()
17211721
if ( sqlite3_step( select ) == SQLITE_ROW )
17221722
{
17231723
srsProj4 = ( const char * ) sqlite3_column_text( select, 0 );
1724+
1725+
if( QString::fromUtf8(( char * )sqlite3_column_text( select, 1 ) ).toInt() != 0 )
1726+
continue;
17241727
}
17251728

17261729
sqlite3_finalize( select );
@@ -1801,7 +1804,7 @@ int QgsCoordinateReferenceSystem::syncDb()
18011804
sql += delim + QString::number( i );
18021805
delim = ",";
18031806
}
1804-
sql += ")";
1807+
sql += ") AND NOT noupdate";
18051808

18061809
if ( sqlite3_exec( database, sql.toUtf8(), 0, 0, 0 ) == SQLITE_OK )
18071810
{
@@ -1816,7 +1819,7 @@ int QgsCoordinateReferenceSystem::syncDb()
18161819
}
18171820

18181821
#if !defined(PJ_VERSION) || PJ_VERSION!=470
1819-
sql = QString( "select auth_name,auth_id,parameters from tbl_srs WHERE auth_name<>'EPSG' AND NOT deprecated" );
1822+
sql = QString( "select auth_name,auth_id,parameters from tbl_srs WHERE auth_name<>'EPSG' AND NOT deprecated AND NOT noupdate" );
18201823
if ( sqlite3_prepare( database, sql.toAscii(), sql.size(), &select, &tail ) == SQLITE_OK )
18211824
{
18221825
while ( sqlite3_step( select ) == SQLITE_ROW )

0 commit comments

Comments
 (0)