I want to publish a layer automatically in geoserver. Each layer is a database table in postgis db. I can see the table in geoserver store(already contains some layer tables of that particular db) as soon as I create it in postgis but publishing it should be done manually. Can I find any php script for just publishing the layer....

Does "Adding a postgis table" section in http://docs.geoserver.org/2.0.x/en/user/extensions/rest/rest-config-examples-curl.html also publishes the layer????


This re-publishes a Layer when the user adds (or deletes) a polygon - it is using WFS-T to add the data to the database from the browser.

Protocol Transactions can be found here:


enter image description here


  • does that mean there is no rest api script for publishing the layers??? Then whats the use of adding them to geoserver??? – Vikash Talanki Jun 14 '11 at 21:49
  • 2
    When you POST the feature type yes a layer is created as well. If you are not able to access it then another error is occurring. – jdeolive Jun 15 '11 at 14:16

You cant do auto publish as per my knowledge ,an alternate way is to publish the layer once and then to overwrite the files and if you want to add data from shape files to database you can append it,you can use this code to add update table via files. shp2pgsql -I -s 4326 -g the_geom(geomrty column name) Filesrc public.tablename| psql -h localhost/IP -d database -U postgres

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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