Monday, 15 February 2016

ogr - Export from PostGIS to SpatiaLite?


My PostGIS database contains OSM data from my country. For transportation reasons I want to export a spatial view I created from that data to a SpatiaLite database.


Is there any way to directly extract my PostGIS view to a SpatiaLite db without resorting to a man-in-the-middle (shapefile then SQLite) solution?


Im using Ubuntu Linux, with PostGIS 2.1 GDAL 191.



EDIT:


Here's a single cmd to export to shapefile:


ogr2ogr -f "ESRI Shapefile"  \
PG:"dbname=dbname user=username password=pass" \
-sql " select * from database where "

If you get a getsrid(geom) error, load in your database the "legacy.sql"


psql -f /path/to/legacy.sql

Answer



ogr2ogr?



See here for more information and maybe here as well


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...