Skip to content

Instantly share code, notes, and snippets.

@dkerkow
Created January 26, 2016 11:12
Show Gist options
  • Save dkerkow/7531cfe47488c169e26f to your computer and use it in GitHub Desktop.
Save dkerkow/7531cfe47488c169e26f to your computer and use it in GitHub Desktop.
Export Postgis Layer Subset to Spatialite with ogr2ogr, using some options for significant speedup
ogr2ogr \
-progress \ # show progress
-dsco SPATIALITE=YES \ # create SQLite DB with spatialite format
-f "SQLITE" \ # use SQLite as output format
-dsco OGR_SQLITE_CACHE=2048MB \ # use increased cache for speedup
-gt 65536 \ # use increased number of rows for each transaction for speedup
landuse.db \ # output filename
PG:"host=localhost user=osm dbname=osm" \ # Postgresql connection string
-sql "SELECT * FROM osm_landusages" # SQL statement for feature selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment