ogr2ogr upload shapefile to postgis

Simple quick upload a shapefile to an existing postgis database into an existing schema called "geodata"

upload shapefile to postgis with ogr2ogr:
# upload shapefile into postgis schema and automatically create the table named "test C:\OSGeo4W\bin\ogr2ogr.exe -lco GEOMETRY_NAME=geom -append -lco SCHEMA=geodata -f "PostgreSQL" PG:"host=domainName port=5432 user=username dbname=dbName password=secretpasswrd" -a_srs "EPSG:3785" C:/somepath/myshapefile.shp -nln NewTableName )

Comments

Popular Posts