This page last changed on May 10, 2010 by aaime.
Add WMS cascading abilities to GeoServer
Assigned to Release
The proposal will be made available in release 2.1. Branch 2.0.x won't be affected.
Choose one of: Under Discussion, In Progress, Completed, Rejected, Deferred
WMS cascading allows for proxying a remote WMS server and merging the results with locally rendered data. This can be useful for a number of reasons:
- watermarking and decoration in general
- proxying a secured remote WMS into an intranet available server
The patch attached to http://jira.codehaus.org/browse/GEOS-623 contains a relatively full fledged implementation of WMS cascading. The following describes the patch changes in some details.
The catalog sees two new CatalogInfo subclasses, WMSStoreInfo and WMSLayerInfo.
WMSStoreInfo, a StoreInfo subinterface, describes a WMS server connection such as the capabilities link, and could contain other information such as authentication credentials and http timeout.
WMSLayerInfo, which extends ResourceInfo contains the layer name and eventually will be be place to host the cascaded named style list as well as cascading image format and other eventual vendor parameter to be used during the cascading.
The ResourcePool has been modified to cache the WebMapServer object used during the cascading operations so that the capabilities request gets cached as a result.
The persistence subsystem (XStream, loader and persister) have been modified to store the new objects following the same conventions as the other stores and resources, the main difference being that the store is described in a wmssstore.xml file whilst the the cascaded WMS layer is described in a wmslayer.xml file.
Example XML file contents for WMS stores:
<name>Atlas of Canada</name>
and for a WMS layer:
<description>Boundaries in the North circumpolar region. The representation of political features on this map may not necessarily represent the position of the Government of Canada on international issues of recognition, sovereignty or jurisdiction.</description>
<abstract>Boundaries in the North circumpolar region. The representation of political features on this map may not necessarily represent the position of the Government of Canada on international issues of recognition, sovereignty or jurisdiction.</abstract>
SPHEROID["WGS84", 6378137.0, 298.257223563]],
AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH]]</nativeCRS>
The CatalogBuilder has been extended to deal with the new objects, as a bonus the builder feeds all metadata coming from the WMS server capabilities document into the WMSLayerInfo ones.
The usual store -> layer workflow has been maintained adding a new custom page to configure the WMS store and modifying the layer listing and layer configuration pages to deal with the fact cascaded layers cannot be styled via SLD (at the time of writing at least).
Icons to identify a WMS store, layer and type have been taken from GeoSilk.
Adding a new store
Listing stores including WMS layers
Configuring a new cascaded layer with metadata coming from the server capabilities document
Cascaded WMS layer showing up in the preview panel
Cascading has been implemented by using the GeoTools WMS client, and in particular the WMSMapLayer class, a MapLayer that makes most of the work making the renderer think it's dealing with a coverage.
- Standard cascading
- Reprojected cascading, including the ability to pass the SRS down to the remote server should the SRS be included among the remote server supported list, otherwise the request is passed down in a supported SRS, adjusting the image ratio accordingly, and reprojecting client side
- GetFeatureInfo cascading for servers that do support the application/vnd.ogc.gml feature info format. Works in both standard and reprojected case.
The following screenshot shows a topp:states layer cascaded from demo.opengeo.org/geoserver, with reprojection and cascaded GetFeatureInfo results:
The patch adds new resources to represent a WMS store and a WMS layer. The follow the same patters as data stores and feature types, but use different locations:
Besides the path the behavior to the various kind of HTTP methods is exactly the same as with data stores and resources, meaning they both can be listed, shown, created by POST, updated by PUT, removed by DELETE. It's also possible to list the available, but still unpublished, wms layers in a given store.
The proposal does not include any of the following desirable features, which will be implemented as time allows:
- add support for alternate named styles
- support for specifying extra request parameters in the layer configuration (time, elevation, cql_filters and whatnot). Could be also used to provide a primitive interface for specifying named styles (freeform is not necessarily bad, some servers do accept more styles than declared in the capabilities document).
- allow the admin to specify a timeout (right now it's hard coded to 5 seconds)
- full support in Restconfig (we need to add new resources there)
- improve the GeoTools client code so that we can use HTTP 1.1 persistent connections and limit the number
of parallel connections we make to a single server (right now GS is badly behaved from an HTTP client point of view, though, as far as we know, not worse behaved than the competition).
- allow the user to choose the format used for cascading. Now we try png
- add a pure proxy mode, if the request contains only cascaded layers avoid decoding the image to just re-encode it afterwards
- add support for WMS with access restrictions
- support cascaded layers in GetMap requests that use &SLD and &SLD_BODY
This section should contain feedback provided by PSC members who may have a problem with the proposal.
There are no backwards compatibility issues.