Skip to content

Commit

Permalink
crssync: exclude some records from updates from GDAL
Browse files Browse the repository at this point in the history
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 7805af3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Binary file modified resources/srs.db
Binary file not shown.
9 changes: 6 additions & 3 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -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 ) );
Expand All @@ -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 );
Expand Down Expand Up @@ -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 )
{
Expand All @@ -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 )
Expand Down

0 comments on commit 7805af3

Please sign in to comment.