Guest User

Untitled

a guest
Jul 24th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. ogr2ogr -update -append -f PostgreSQL PG:"dbname=geodb user=postgres password=admin" myshp.shp -nln existing_table
  2.  
  3. import os
  4. import process
  5. cmd='ogr2ogr -update -append -f PostgreSQL PG:"dbname=geodb host=localhost port=5432 user=postgres password=admin" myshp.shp -nln existing_table'
  6. input_command = [cmd]
  7. program='C:/Program Files (x86)/FWTools2.4.7/bin/ogr2ogr.exe'
  8. command_run = subprocess.call([program, input_command])
  9. if command_run == 0:
  10. print "Its worked!!"
  11. else:
  12. print 'no'
Add Comment
Please, Sign In to add comment