Friday, August 26, 2011

Cascaded Layers and Themes

Today I want to talk about an experimental way to configure cascaded layers.

I already talked about a new layers and themes concept. In order to test out how this can work, I've now implemented an experimental way to cascade a WMS. This is a different approach than the one I already talked about, it focuses on cascading a complete service rather than a single layer.

So we have a couple of different resources here. The first and most basic resource is a remote OWS (OGC Web Service). There are now two different remote OWS resource types, with the old one still being used by the traditional cascading layers concept. The new one is currently a lot simpler to configure:

<?xml version="1.0"?>
<RemoteWMS xmlns=""
  xsi:schemaLocation=" remotewms.xsd"
    location=";service=WMS&amp;version=1.1.1" />

Please note that the namespace differs from the traditional remote WMS store. The only thing to configure here is the location of the WMS capabilities document.

The next resource we have is a LayerStore. A remote WMS layer store can be used to provide a 'copy' of all the layers a remote WMS has. The configuration simply consists of telling the store which remote WMS to use:

<?xml version="1.0"?>
xsi:schemaLocation=" remotewms.xsd"
Next is the configuration of a Theme. The configuration of a theme is also pretty straightforward. It also needs a remote WMS, and it needs to have layer stores:

<?xml version="1.0"?>
xsi:schemaLocation=" remotewms.xsd"
The interesting thing here is what happens here. As you might remember, a theme combines sub-themes and layers to what is traditionally known as layer trees. You can now use theme references to configure your WMS layer structure (as we will see below).

The remote WMS theme creates a theme structure which is identical to the layer structure of the remote WMS. It then tries to find matching layers from the available layer stores, and inserts them at the appropriate places. If the layer store coincides with the remote WMS layer store (as in our case) you'll get the same structure as the cascaded WMS.

The WMS configuration is then as simple as this:


And that's it. True, you had to edit four files, but all are very simple to understand. Cascading a WMS with 524 layers used to be harder...

If you do a quick GetCapabilities, you'll see that bounding boxes, metadata etc. are just copied from the remote service. In the future it will of course be possible to manually create a custom theme, which can then be used to only select a couple of layers from the remote WMS, mix them with other layers and add/edit metadata.

I think this proves that the layers/themes concept can work. To further test it, a couple of prototypic other layer stores will be implemented soon.

No comments:

Post a Comment