Hi Xiaoyu,

when you are talking about wirting a python scripting - there are up to date python bindings for the OGR library. So you could parse your shapefile with python and write it directly to the database.For the documentation the python bindings see [1], you can also find some example code at Matt Perry´s blog at [2].

For accessing the database you can use the ogr-library again or the pycopg2 postgres driver [3].

Links:
[1] http://trac.osgeo.org/gdal/wiki/GdalOgrInPython
[2] http://www.perrygeo.net/wordpress/?p=4
[3] http://pypi.python.org/pypi/psycopg2/2.0.4

Nico

Xiaoyu Guan schrieb:
Dear all:
Thanks for your information. I still have no time to check all the information. it is nice to know we are working on the same problems. Here I also found some PHP source code from OGR. please, check the following link.
http://dl.maptools.org/dl/php_ogr/php_ogr_documentation.html
The OGR/PHP extension enables PHP users to access the functionalities included in the OGR library. This extension can be used as built-in PHP or as dynamic library (".dll" on Windows or ".so" on Unix).

The problem is that the version of OGR/PHP for windows platform is quite old. it is need PHP 4.3.x. It is easy to install PHP, but it is not easy to find PHP 4.3 win installer.

until now, I have already see there are some solutions are writen in PHP. I am still wonder whether possible to write a python script which allow user from web access the shp2pgsql on the server? Maybe it is take less time for converting.

QGIS is a nice tool. but for this case, we need a thin client (Web client).

All the best

Xiaoyu
------------------------------------------------------------------------

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to