Update bounds srs.db in source from epsg db

This commit is contained in:
Nathan Woodrow 2017-11-27 11:42:06 +10:00
parent 149e331d2c
commit 877c0dc252
3 changed files with 11 additions and 6460 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,11 +30,14 @@ def gen():
"""
rows = db.execute(query)
with open("resources/epsg_areas.csv", "w") as f:
f.write("coord_sys_code, west_bound_lon, north_bound_lat, east_bound_lon, south_bound_lat\n")
for row in rows:
csv = ",".join(str(data) for data in row)
f.write('{0}\n'.format(csv))
srsdb = sqlite.connect("./resources/srs.db")
srsdb.execute("DELETE FROM tbl_bounds")
data = list(rows)
srsdb.executemany("""insert into tbl_bounds(srid, west_bound_lon,
north_bound_lat,
east_bound_lon,
south_bound_lat) values (?,?,?,?,?)""", data)
srsdb.commit()
def usage():

View File

@ -1058,9 +1058,9 @@ QgsRectangle QgsCoordinateReferenceSystem::bounds() const
return QgsRectangle();
}
QString sql = QStringLiteral( "select west_bound_lon, north_bound_lat, east_bound_lon, south_bound_lat from tbl_srs "
"where srs_id=%1" )
.arg( d->mSrsId );
QString sql = QStringLiteral( "select west_bound_lon, north_bound_lat, east_bound_lon, south_bound_lat from tbl_bounds "
"where srid=%1" )
.arg( d->mSRID );
statement = database.prepare( sql, result );
QgsRectangle rect;