#

## OpenGeo Stack Workshop

# Adding a PostGIS Table to GeoServer

In this section the PostGIS tables created in previous sections will be published as GeoServer feature types using skills learned in previous modules.

1. From the Config page navigate to Data ‣ FeatureTypes ‣ New.

2. Select postgis:::bay_area_roads from drop down list and click New.

   Creating the bay_area_roads feature type

   Note

   The drop down list contains a list of the tables which are available to be published. When a table is chosen from the list a new Feature Type is created from it.

3. On the FeatureType Editor page, change the style by selecting line from the Style drop down list.

   Setting the default style for the bay_area_roads feature type

4. Generate the bounds for the layer by clicking Generate located on the middle of the page.

   Generating the bounds of for the bay_area_roads feature type

5. Scroll to the bottom of the page and click Submit.

6. Apply and Save changes.

7. View the new layer from the Map Preview by clicking the topp:bay_area_roads link.

   Selecting the bay_area_roads for map preview

   The bay_area_roads map preview

   Warning

   Is the map blank? A common problem is that the default style is not set properly. Double check the style on the layer.

8. Add the bay_area_transit_routes table repeating steps 1 through 7. Remember to:

   - Set the Style dropdown to line
   - Set the bounds with the Generate button
   - Click Apply after clicking Submit

   Creating the bay_area_transit_routes feature type

   Setting the default style for the bay_area_transit_routes feature type

   Generating the bounds for the bay_area_transit_routes feature type

   The bay_area_transit_routes map preview

9. Add the bay_area_transit_stations, and bay_area_bus_stops tables repeating steps 1 through 7. Set the default style to point for the feature types.

10. Verify all feature types are configured properly with the Map Preview.

    Map preview of the bay_area_transit_stations feature type

    Map preview of the bay_area_bus_stops feature type

At this point GeoServer is publishing all the data in the PostGIS database. The next few modules will focus on styling this data.

### Navigation

- index
- modules |
- next |
- previous |
- OpenGeo Stack Workshop »
- Working With PostGIS »
- Adding a PostGIS Table to GeoServer