Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have py script which is creating shapefiles using Once the shapefile is created I have to add them manually to the geoserver. Is there a way to add it dynamically to the geoserver? through postgis or something?


Ok so seems my project manager has changed his plan, he wants me to add the shapefiles to the PostGIS Database which will update the newly added shapefiles to the geoserver where there will be a connection to the PostGIS Database. Is it possible to update the newly added shapefiles to reflect in the Geoserver?

share|improve this question

You can use the REST API of GeoServer.

The REST extension provides a RESTful interface through which clients can configure a GeoServer instance through simple HTTP calls. With it clients can programatically configure the data served by GeoServer.

This example explains how to upload a shapefile in GeoServer using cURL.

share|improve this answer

with python there are some scripts about shp to geoserver... you can check out them for your needs. They will help you to make this work(from here):

Copied a shapefile (and associated files) to the data directory
Appended info block to catalog.xml
Created named FeatureType directory and associated info.xml

i hope it helps you...

share|improve this answer
hi @Aragon, i know it has been a long time but should I simply import in my py script and provide the (shp,featureid,sld,srs)? How do I use the – Sam007 Nov 8 '12 at 1:53

You could of course add your shapefile to postGIS using, for example, ogr2ogr ( ).

If you append your data to an existing table the data should be included in the geoserver layer you've made for the table. If you are creating a new table (possibly what you are doing, since schemas will vary from shapefile to shapefile, you could use the beforementioned REST api to add the new table as a layer (provided that you have the datastore set up). See

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.