Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ogr2ogr -update -append -f PostgreSQL PG:"dbname=geodb user=postgres password=admin" myshp.shp -nln existing_table
- import os
- import process
- cmd='ogr2ogr -update -append -f PostgreSQL PG:"dbname=geodb host=localhost port=5432 user=postgres password=admin" myshp.shp -nln existing_table'
- input_command = [cmd]
- program='C:/Program Files (x86)/FWTools2.4.7/bin/ogr2ogr.exe'
- command_run = subprocess.call([program, input_command])
- if command_run == 0:
- print "Its worked!!"
- else:
- print 'no'
Add Comment
Please, Sign In to add comment