Introduction to the OpenGeo Suite

Creating a layer group

A layer group, as its name suggests, is a group of layers. Grouping is useful when creating a “basemap”, or other situations when many single layers are requested simultaneously and frequently from a WMS. Layer groups also let you combine data with different geometries and content.

In the previous sections, we loaded multiple layers from PostGIS. Now we’ll use a layer group to combine them into a single virtual layer.

  1. From the GeoServer web interface page, click the Layer Groups link, under Data on the left side of the page.

    ../_images/layergroup_link.png

    Click to go to the Layer Groups page

  2. Click Add new layer group at the top of the page.

    ../_images/layergroup_page.png

    Layer Groups page

  3. Enter earthmap in the Name field. Don’t click Save yet.

    ../_images/layergroup_new.png

    Creating a new layer group

    Note

    Skip the Bounds and other form fields for now.

  4. Now we will add layers to our layer group. Scroll down click the Add Layer link.

    ../_images/layergroup_addlayerlink.png

    Link to add layers to the layer group

  5. Select each of the following layers so that they appear in this order:

    • earth:shadedrelief
    • earth:ocean
    • earth:countries
    • earth:citybuffers
    • earth:cities
    ../_images/layergroup_add.png

    Adding a layer to the layer group

    Note

    To make it easier to find the appropriate layers, type in earth in the search box to narrow the listing.

    Layer order in the group definition is important. The top layer in the list will be drawn first, the bottom last. Make sure to match the order of the above list.

  6. Reorder the layers if necessary by clicking on the Position arrows for each layer.

  7. Check the Default Style box for all four layers.

  8. Now, click the Generate Bounds button to determine the bounding box for the entire layer group. This button will also determine the projection of the layer group, equal to the top layer’s projection by default. If the projection is not found automatically, enter EPSG:4326.

    ../_images/layergroup_complete.png

    Completed layer group

  9. Click Save when done.

  10. Preview the layer by going to the Layer Preview.

    ../_images/gs_layergroup.png

    Previewing the layer group



Continue Reading

Previous: Styling Layers in GeoServer

Next: Other protocols

This Page

About Boundless

Boundless provides commercial open source software for internet mapping and geospatial application development. We are dedicated to the growth and support of open source software.

License

This work is licensed under a Creative Non Commercial-Commons Attribution-Share Alike 3.0 United States License. Feel free to use this material, but we ask that you please retain the Boundless branding, logos and style.

Creative Commons License