Adding a Postgis layerΒΆ
This task shows how to add a PostGIS layer into GeoServer:
Navigate to the GeoServer Welcome Page.
If you are not already logged in, on the Welcome page locate the Login form located at the top right corner, and enter the username admin and password Geos.
Click the Add stores link.
Select the PostGIS link and click it.
On the New Vector Data Source page fill the following parameter:
- Data source name, ‘shape’
- host, ‘localhost’
- port, ‘5434’
- database, ‘shape’ the name of the database created in previous workshop step.
- schema, ‘public’
- user, ‘geosolutions’ the name of the user database owner.
- password, ‘Geos’ the user password.
and click Save.
After saving, you will be taken to a page that lists all the layers in the PostGIS database and gives you the option to publish any of them. Click Publish.
The Name and Title fields should be automatically populated. Fill the Declared SRS field to set the Coordinate Reference Systems and generate the bounds for the layer by clicking the Compute from data and Compute from native bounds buttons in the Bounding Boxes section
Scroll to the bottom of the page, notice the read only Feature Type Detail table and then click Save.
If all went well, you should see something like this:
At this point the PostGIS layer has been added and is ready to be served by GeoServer. Use the layer preview to view its contents, filtering on the ‘main_road’ name.