2

I am a web developer working with GIS guys who are concurrently working on a vector layer that updates every week or so, however, on our mapping application there are about 30 layers that would need to be deleted and recreated with the GeoServer interface. This process kills about 5 hours every week by hand and I want to automate the process.

I am handed a shapefile and a list of layers which do not change. I imagine I am essentially updating the datastore, but when I try to update just the datastore the layers in my application stop working.

How can I update just the datastore without deleting and re-adding every layer?

2
  • I have not had much luck with GeoServer seeing the new files automatically. Provided the files are all the same names and nothing changes, we generally shutdown Geoserver, dump the new versions of files in and then restart it again and GeoServer finds the new files nicely. Reloading the Catalog on the Status Page can sometimes work as well but I have had layers stop working and had to reset them up from scratch again. @MappaGnosis is right, with that many layers and frequency, you may be better off using a PostgresSql Database. Import the shapefiles (using shp2pgsql) to the database into a pro Commented Jun 26, 2014 at 17:17
  • Alternatively look at the rest interface which is designed for this. docs.geoserver.org/stable/en/user/rest
    – Ian Turton
    Commented Jun 27, 2014 at 7:36

1 Answer 1

3

You do not need to recreate the datastore every time. It is just a pointer to a location on your disk. In the case of shapefiles, you can simply copy the new ones into the relevant folder and (assuming the files have the same names and are already referenced as layers in Geoserver), the update is done (without touching Geoserver).

Given the number of files and frequency of update, it might be better if your GIS people were using a spatial database like PostGIS. Then you would not need to do anything at all (unless they create a new layer, and then you just need to publish it - ditto with any new shapefiles previously unpublished).

If you have cached tiles for a wms service built on the shapefiles, then you will probably want to reseed the cache following an update.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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