[GIS] Automating Geoserver & OpenLayers setup

geoserveropenlayers-2postgis

I'm using OpenLayers, Geoserver, and PostGIS. For now, everything is fine and happy. I have 2 layers showing on my map through WMS from geoserver. I am taking following steps:

Step 1: inserting data into postgis – done manually.

step 2: if it is a feature in already present layer then reloading the page add that feature on the map, but for adding the table for a layer into geoserver, I am publishing it manually.

step 3: including that layer code into JS manually

I want everything to be done automatically. Since my project is to be handed over to a client and they should be given the possibilitz to add features, layers etc. I think automation is necessary.

So I want:

Step 1: inserting data into postgis – can be achieved by providing a form to user and using a php I can insert them into postgis

Step 2: publishing of layer(selecting a style also) in geoserver – has to be done programmatically

Step 3: inserting this layer code in JS – to be done problematically.

I request your good guidance on this issue. Thank you.

Best Answer

I had almost the same issues as you last year, when I worked on an open-source (PostgreSQL&PostGIS database + Geoserver + Javascript frontend) WebGIS architecture.

I developed on Ubuntu and solved the automation issues using a mixture of CRONed bash scripts, which:

  1. periodically performed SQL queries to insert/modify features into the DB. Data was stored under a filesystem folder into CSV text files, which were read by the scripts and pumped into the DB.
  2. added new raster data, whenever available, calling Geoserver REST APIs

Javascript code had not to be modified because it automatically loaded all of the Geoserver layers.

Hope this kind of approach can help you...