Skip to content
Permalink
Browse files

allow crs without projection entries (fixes #6117)

  • Loading branch information
jef-n committed Jul 29, 2012
1 parent 431f29d commit 12106b8b8b638f3543e49807334f6dd7bbbb7480
Showing with 23 additions and 15 deletions.
  1. BIN resources/qgis.db
  2. BIN resources/srs.db
  3. +23 −15 src/app/qgisapp.cpp
BIN +0 Bytes (100%) resources/qgis.db
Binary file not shown.
BIN +0 Bytes (100%) resources/srs.db
Binary file not shown.
@@ -1987,21 +1987,6 @@ bool QgisApp::createDB()
"is_geo integer NOT NULL,"
"deprecated boolean);"
"CREATE INDEX idx_srsauthid on tbl_srs(auth_name,auth_id);"
"DROP VIEW vw_srs;"
"CREATE VIEW vw_srs as "
"select a.description as description,"
"a.srs_id as srs_id,"
"a.is_geo as is_geo,"
"b.name as name,"
"a.parameters as parameters,"
"a.auth_name as auth_name,"
"a.auth_id as auth_id,"
"a.deprecated as deprecated"
" from "
"tbl_srs a inner join tbl_projection b on a.projection_acronym=b.acronym"
" order by "
"b.name,"
"a.description;"
"INSERT INTO tbl_srs(srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) SELECT srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,'','',is_geo,0 FROM tbl_srs_bak;"
"DROP TABLE tbl_srs_bak", 0, 0, &errmsg ) != SQLITE_OK
)
@@ -2013,6 +1998,29 @@ bool QgisApp::createDB()
}
}

if ( sqlite3_exec( db,
"DROP VIEW vw_srs;"
"CREATE VIEW vw_srs AS"
" SELECT"
" a.description AS description"
",a.srs_id AS srs_id"
",a.is_geo AS is_geo"
",coalesce(b.name,a.projection_acronym) AS name"
",a.parameters AS parameters"
",a.auth_name AS auth_name"
",a.auth_id AS auth_id"
",a.deprecated AS deprecated"
" FROM tbl_srs a"
" LEFT OUTER JOIN tbl_projection b ON a.projection_acronym=b.acronym"
" ORDER BY coalesce(b.name,a.projection_acronym),a.description", 0, 0, &errmsg ) != SQLITE_OK
)
{
QMessageBox::critical( this, tr( "Private qgis.db" ), tr( "Update of view in private qgis.db failed.\n%1" ).arg( QString::fromUtf8( errmsg ) ) );
sqlite3_free( errmsg );
sqlite3_close( db );
return false;
}

sqlite3_close( db );
}
return true;

0 comments on commit 12106b8

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