Skip to content

Instantly share code, notes, and snippets.

@arbakker
Created August 20, 2014 10:47
Show Gist options
  • Save arbakker/82dc88192f3445eb5703 to your computer and use it in GitHub Desktop.
Save arbakker/82dc88192f3445eb5703 to your computer and use it in GitHub Desktop.

Manual to publish postgis layer in GeoServer

Install GeoServer (in this case Geoserver 2.5.2) on machine, then acces the adminpanel of geoserver through: localhost:8080/geoserver/web

And login with user admin and pass geoserver.

1. Create workspace in

Go to Workspaces and click 'Add new workspace'.

2. Create postgis datastore

Go to Stores and click 'Add new Store', choose PostGIS database. Next choose the workspace created at 1 and fill in the connection details of your PostGIS service and database.

3. Publish layers

Go to Layers and click 'Add new resource', then choose the datastore you created at 2 from the dropdown-list. This will give you a list of tables from the PostGIS database, which you can publish. Obivously the layers to publish need to have a geometry column. You can configure the layer by filling in the details and you have to set the 'Bounding Boxes' by clicking on 'Compute from data' and 'Compute from native bounds'.

4. Preview layers

Go to Layer Preview to view your just published layers in the openlayers client. If you click on the list icon in the top corner you can adjust the WMS query, by adding a CQL filter, changing the image format, change the style of the layer etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment