Hi all,
I'm writing this mail to start some discussion and gather
some feebdack on a feature that we are going to implement
sometimes soon: WMS cascading (warning, long mail).
It is something that deserves its own GSIP of course, with
this mail I'm just trying to introduce the topic and consider
alternative designs.
Functionality wise, we'd like to have the ability to configure
layers that are cascaded from another WMS server.
The minimal requirement is to cascade a layer as is, so,
configure the WMS capabilities URL, the layer name, and that's
it.
In a second step it would be nice to configure also the named
style to use (if multiple ones are available), the format
used in the request (png, jpeg, ...) and the ability to add
a set of extra options that would cover at the same time
unforeseeable vendor options and standard options that we
might not care to build a custom GUI for (for example, time and
elevation).
The main machinery to do cascading is provided by the gt-wms
module.
Implementation wise, there are two options, fake coverage
store or native implementation.
I think we want to go native implementation, but let me present
them both.
Fake coverage store
----------------------------------------------------------
A "fake coverage store" option would involve creating a coverage
format and a coverage reader that can read the cascaded
layer and present it as a coverage to GeoServer.
Pros:
- simple enough to implement
- would not require changes to the configuration classes
- we could cascade the remote WMS also via WCS, which would
make some sense if the cascaded layer is a raster
Cons:
- butt ugly interface: all the parameters to configure
the cascade layers would have to be provided in the
coverage configuration, in particular, in a URL
- the layer would be styled as a raster instead of presenting
the styles available on the cascaded server
- no sane way to implement a GetFeatureInfo against that
layer, GS will assume it's a coverage and return the
RGB value of the cell you clicked onto it instead of
cascading the request back to the originating server
(possibly as a GML one so that we can use our templates)
- same goes for GetLegendGraphics, being a coverage we
would show the generic raster legend instead of trying
to cascade the other server one.
- we would cascade as WCS also remote layers that are
actual rendered vector data. That would make no sense.
Native implementation
----------------------------------------------------------
A "native implementation" would require creating new
configuration objects, WMSStoreInfo, WMSLayerResource,
and possibly a WMSLayerInfo.
WMSStoreInfo would hold a reference to the remote store
and provide a list of available layers, WMSLayerResource
would contain the "access" configuration such as the
image format and the vendor parameters to include in the
request, the WMSLayerInfo the named style that we want
to use for cascading.
Or... we could just have WMSLayerInfo, a specialized layer
that has all the above informations (avoiding WMSLayerResource).
Would make some sense, as for cascaded layers there is no
actual "resource", no actual data, we're just cascading
images (so it makes some sense to just represent publishing
level information), and we could have some sort of "plain"
resource to keep the usual information such as bboxes
and crs and the like. That is, a plain implementation
of ResourceInfo without extra infos in it.
Pros:
- models the concept of a cascaded layer better
- allows to make a nice GUI for the store and the
layers
- allows to recognize the WMS layers for what they
are and implement all the WMS operations accordingly
Cons:
- it's more work, we have to create the new catalog
beans, modify the persistence to handle them
Work wise the things are not so bad. We could actually
leave the Catalog interface as is, as it already provides
generic methods for accessing _any_ kind of resource, not
just feature type infos and coverage infos:
public <T extends StoreInfo> T getStore(String id, Class<T> clazz)
public <T extends ResourceInfo> T getResource(String id, Class<T> clazz)
public LayerInfo getLayer(String id)
We would need to modify the XStream persistence to handle
the new classes gracefully though.
Some changes might be required in RESTConfig as well, I did not
look into it that much.
Attack plan
---------------------------------------------
The rough plan for this would be:
- gather feedback from this mail
- prepare a GSIP
- implement cascading in the simplest possible way: just
cascade a layer with its default style with no extra parameters
- cascade GetFeatureInfo and GetLegendGraphics for the simple
cases
Once that is done we can take our time to implement extended
functionality:
- use alternate styles
- support vendor parameter
- set the image format used for cascading
- whatever else we may fancy
Where to do the work
---------------------------------------------
The work would require quite some changes, so I suggest we
do it on trunk.
Opinions?
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.