Showing posts from November, 2015

How to import Spatialite into PostGIS using ogr2ogr

GOAL: Import a Spatialite table into an existing PostGIS table appending (inserting) new rows using ogr2ogr. The trick is we want to map the fields to import to the correct corresponding PostGIS columns.  First get the list of Spatialite fields using ogrinfo  ogrinfo somedb.sqlite sqliteTableName INFO: Open of `..\sqlite\socgen-db-final.sqlite'       using driver `SQLite' successful. Layer name: e00_poly_join Geometry: Polygon Feature Count: 60 Extent: (-168613.719162, 5983831.402051) - (-168508.270008, 5983961.187764) Layer SRS WKT: PROJCS["WGS 84 / Pseudo-Mercator",     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"