I just export a PostGIS Table to shp using this tips but I'm not able to import a shp to PostGIS using the same library(ogr). Any idea?
Python – How to Import Shapefile to PostGIS Using OGR
importogrpostgispythonshapefile
importogrpostgispythonshapefile
I just export a PostGIS Table to shp using this tips but I'm not able to import a shp to PostGIS using the same library(ogr). Any idea?
Best Answer
In pure Python, without using the subprocess module (os.system is deprecated) to call
ogr2ogr
orshp2pgsql
, for example):1) with ogr
2) with ogr and psycopg2 from the book Python Geospatial Development (Eric Westra), Chapter 7, p.219
3) with psycopg2 only
4) with psycopg2 and other spatial libraries