Hi Stoyan:
Thanks a lot for sharing your py script.
I am wondering whether can implement your ideas on my situations.
I want to write a python script which can upload shapefiles into certain database(PostGIS), and connect to Geoserver and automatically styling the data layer. then render the datalayer in the map.
Is possible for me to combine your script with mine? editing certain ‘certain xml’ and reboot geoserver ?
Here is my script(the tool make use psql and shp2pgsql import shapefiles to postgis):
import os, string
Psql= 'C:\temp\bin\psql.exe ’
Shp2pgsql='C:\temp\bin\shp2pgsql.exe ’
shapefile=‘C:\X_GUAN\data\bc_border.shp’
sqlfile= ‘C:\test.sql’
options= "-s 4326 -i -I "
cmd = Shp2pgsql + options + shapefile + ’ test > ’ + sqlfile
cmd2 = Psql + '-d databaseTest -f ’ + sqlfile
os.system(cmd)
os.system(cmd2)
Thanks in advance
All the best
Xiaoyu