Geoscience Reference
In-Depth Information
Indexing database tables is often recommended as it speeds up SQL queries and
other database operations. We can use Spatialite to create an index on the table
subset_ile_de_france by issuing the next command followed by the vacuum
on the table:
spatialite> create unique index spatidx on
subset_ile_de_france(osm_id);
spatialite> vacuum subset_ile_de_france;
2.7.3 ogr2ogr with Spatialite
This next section will demonstrate how you can create a Spatialite database using
ogr2ogr and to add multiple spatial vector datasets to it. We begin by using
ogr2ogr to create the Spatialite database from the OSM ESRI Shapefile:
ogr2ogr -f "SQLite" myfile.sqlite subset_ile-de-france.shp
A quick consistency check on the database using ogrinfo returns basic infor-
mation about the newly created Spatialite database, including the geometry type, the
number of features within the layer and its spatial extent.
ogrinfo -so -al myfile.sqlite
INFO: Open of 'myfile.sqlite'
using driver 'SQLite' successful.
Layer name: subset_ile_de_france
Geometry: Polygon
Feature Count: 27012
Extent: (1.700000, 48.272681) - (2.130000, 48.630000)
Layer SRS WKT:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
FID Column = OGC_FID
Geometry Column = GEOMETRY
osm_id: String (0.0)
osm_way_id: String (0.0)
name: String (0.0)
type: String (0.0)
aeroway: String (0.0)
amenity: String (0.0)
admin_leve: String (0.0)
barrier: String (0.0)
 
 
Search WWH ::




Custom Search