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

David Calle davydky at gmail.com
Thu Aug 21 07:13:10 PDT 2008


Hi Xiaoyu!
It's so interesting...
I need the same but my shp files comes from Argis...  Can I use this scrip
for convert the shapes files on my html file...?

Thanks..!

2008/8/21 Xiaoyu Guan <guanxiaoyu at gmail.com>

> 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
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080821/bd970bff/attachment.html>


More information about the postgis-users mailing list