Skip to content
Permalink
Browse files

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));
  • Loading branch information
jef-n committed Jul 4, 2013
1 parent 3f9890f commit 7805af3cf1afdb18424df9e1a8785c808b7b3b2d
Showing with 6 additions and 3 deletions.
  1. BIN resources/srs.db
  2. +6 −3 src/core/qgscoordinatereferencesystem.cpp
BIN +15 KB (100%) resources/srs.db
Binary file not shown.
@@ -1710,7 +1710,7 @@ int QgsCoordinateReferenceSystem::syncDb()
continue;
}

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

if( QString::fromUtf8(( char * )sqlite3_column_text( select, 1 ) ).toInt() != 0 )
continue;
}

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

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

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

0 comments on commit 7805af3

Please sign in to comment.
You can’t perform that action at this time.