OpenGeo

OpenGeo Stack Workshop

Previous topic

Loading Spatial Data

Next topic

Adding a PostGIS Table to GeoServer

Adding a PostGIS Database to GeoServer

In previous modules the task of creating a GeoServer data store for spatial data in Shapefile format was covered. This section covers the similar task of creating a data store for the PostGIS database created in previous sections.

  1. From the Welcome Page navigate to Config ‣ Data ‣ DataStores ‣ New.

  2. Select Postgis from the drop down list, enter “postgis” in the text box and click New.

    ../_images/gs_db_add1.jpg

    Creating a new PostGIS data store

  3. On the Feature Data Set Editor page:

    • Enter “bayarea” in the database field
    • Enter “postgres” in the user field
    • Enter “postgres” in the password field
    ../_images/gs_db_add2.jpg

    Configuring a PostGIS database connection

    Note

    The editor page is used to enter all the database connection information. It also provides a number of parameters that can be used to tune database performance such as connection pool size, which specifies how many open database connections can exist concurrently.

  4. Submit the form and then click Apply and then Save located in the top left corner of the page.

At this point GeoServer has successfully connected to PostGIS, however no data has been published yet. In the next section each table created in previous sections will be published as a feature type.