WMS Reader

Description

Returns the image (or error message) produced by a WMS server according to the GetMap request parameters.
This reader redirects WMS request to another server, using parameters specified in the Cocoon sitemap.
The configuration of the WMS server parameters is done when defining the reader, while the rest of WMS parameters are defined in the pipeline.

This components has its own cache mechanism (of course, under the hood it still uses the Cocon cache) to cache WMS responses. It encodes the whole URI (including request parameters) into the cache-key to ensure the proper caching of WMS request regardless of the browser or application server cache settings.

Some parameters are defined when configuring the component, while others are defined in the match (actually, some may be defined in the component configuration and re-defined, if need be, during matching).

Sitemap component configuration

<map:reader name="wmsmc" src="org.cocoondev.geoid.reading.WMSReader" logger="geoid" mime-type="image/png" server="www.myserver.com:8080" path="geoserver/wms" sld-path="http://www.myserver.com:8080/cocoon/sld/" wfs-path="http://www.myserver.com:8080/wfs" version="1.1.1" expires-seconds="0"/>
  1. mime-type Returned map image content type
  2. server The address on which the map server is serving requests
  3. path Path of the map-server
  4. sld-path Path of the application serving SLDs
  5. wfs-path Path of the application serving WFSs
  6. version Version of WMS to use
  7. expires-seconds The cache expiration time in seconds. Use 0 for no caching.

Sample sitemap pipeline

<map:read type="wmsmc"> <map:parameter name="layers" value="topp:states"/> <map:parameter name="srs" value="EPSG:4326"/> <map:parameter name="bbox" value="-84.375,39.375,-78.75,45"/> <map:parameter name="width" value="500"/> <map:parameter name="height" value="400"/> <map:parameter name="transparent" value="true"/> <map:parameter name="bg-color" value="${mapserver.map-bgcolor}"/> <map:parameter name="sld" value="states.sld"/> <map:parameter name="format" value="image/gif"/> <map:parameter name="version" value="1.0.0"/> <map:parameter name="cql_filter" value="STATE_ABBR='NJ'"/> </map:read>

All of the above parameters, bar the GeoServer-specific cql_filter one, are defined in the WMS standard, some of them have default values for added convenience. Other parameters may be added to a request, just see the WMS standard for details.