[postgis-users] Re: Upload a shapefile to PostGIS via Web?

Xiaoyu Guan guanxiaoyu at gmail.com
Thu Aug 21 06:56:17 PDT 2008


Dear All:
I wrote a small python script which could convert shapefile to sql. I still
wondering it is possible to run this kind of tool on Apache + Mod_python.
Here is my codes.

import os, string
Psql= 'C:\\temp\\bin\\psql.exe '
shapefile='C:\\X_GUAN\\data\\bc_border.shp'
sqlfile= 'C:\\test.sql'
options= "-s 4326 -i -I "
Shp2pgsql='C:\\temp\\bin\\shp2pgsql.exe '
cmd = Shp2pgsql + options + shapefile + ' test > ' + sqlfile
os.system(cmd)

cmd2 = Psql + '-d databaseTest -f ' + sqlfile
os.system(cmd2)

Thanks in advance

All the best

Xiaoyu




-- 
Xiaoyu Guan (Sam)
Geo-information Science
Wageningen UR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080821/facb4f91/attachment.html>


More information about the postgis-users mailing list