| org.vfny.geoserver.wms.requests.WmsKvpRequestReader org.vfny.geoserver.wms.requests.GetMapKvpReader
All known Subclasses: org.vfny.geoserver.wms.requests.GetKMLReflectKvpReader,
GetMapKvpReader | public class GetMapKvpReader extends WmsKvpRequestReader (Code) | | Builds a GetMapRequest object given by a set of CGI parameters supplied in
the constructor.
Mandatory parameters:
- LAYERS layer names, as exposed by the capabilities document, to compose
a map with, in the order they may appear, being the first layer the one at
the bottom of the layer stack and the last one the one at the top.
- STYLES list of named styles known by this server and applicable to the
requested layers. It can be empty or contain exactly as many style names as
layers was requested, in which case empty strings could be used to denote
that the default layer style should be used. (exaple:
LAYERS=buildings,roads,railroads&STYLES=,centerline, . This
example says create a map with roads layer using its default style, roads
with "centerline" style, and railroads with its default style.
- BBOX Area of interest for which to contruct the map image, in the
Coordinate Reference System given by the SRS parameter.
- FORMAT MIME type of the resulting map, must be one of the advertised in
the capabilities document.
- WIDTH desired map witdth in output units (pixels). UNITS support should
be added to the spec, and UNITS and DPI parameters added.
- HEIGHT desired map height in output units (pixels). UNITS support should
be added to the spec, and UNITS and DPI parameters added.
Optional parameters:
- SRS
- TRANSPARENT boolean indicatin wether to create a map with transparent
background or not (if transparency is supported by the requested output
format).
- EXCEPTIONS MIME type of the exception report.
- BGCOLOR map background color, in
0xRRGGBB format.
- SLD client supplies a URL for a remote SLD document through this
parameter. This parameter takes precedence over STYLES. If present, replaces
the LAYERS and STYLES parameters, since they're defined in the remote
document itself. The document send by this way will be used in "literal" or
"library" mode, see explanation bellow.
- SLD_BODY client spplies the SLD document itself through this parameter,
properly encoded for an HTTP query string. This parameter takes precendence
over STYLES and SLD. If present, replaces the LAYERS and STYLES parameters,
since they're defined in the inline document itself. The document send by
this way will be used in "literal" or "library" mode, see explanation bellow.
As defined by the Styled Layer Descriptor specification, version 1.0.0, the
SLD document supplied by the SLD or SLD_BODY parameter can be used in
"literal" or "library" mode, depending on whether the LAYERS=
parameter is present.
Here is the explanation from the spec, section 6.4, page 10: "the SLD can
also be used in one of two different modes depending on whether the LAYERS
parameter is present in the request. If it is not present, then all layers
identified in the SLD document are rendered with all defined styles, which is
equivalent to the XML-POST method of usage. If the LAYERS parameter is
present, then only the layers identified by that parameter are rendered and
the SLD is used as a style library . "
author: Gabriel Roldan, Axios Engineering author: Simone Giannecchini, GeoSolutions version: $Id: GetMapKvpReader.java 7749 2007-11-13 20:52:54Z jdeolive $ |
Method Summary | |
public static void | addStyles(GetMapRequest request, MapLayerInfo currLayer, StyledLayer layer, List layers, List styles) the correct thing to do its grab the style from styledLayers[i] inside
the styledLayers[i] will either be : a) nothing - in which case grab the
layer's default style b) a set of: i) NameStyle -- grab it from the
pre-loaded styles ii)UserStyle -- grab it from the sld the user uploaded
NOTE: we're going to get a set of layer->style pairs for (b). | public void | filterBaseMap(Map layers, Map styles) Filters the layers and styles if the user specified "layers=basemap". | public static CoverageInfo | findCoverageLayer(GetMapRequest request, String layerName) | public static FeatureTypeInfo | findFeatureLayer(GetMapRequest request, String layerName) | public static Style | findStyle(GetMapRequest request, String currStyleName) | static String | fixURL(String url) URLEncoder.encode does not respect the RFC 2396, so we rolled our own
little encoder. | public Request | getRequest(HttpServletRequest httpRequest) Produces a GetMapRequest instance by parsing the GetMap
mandatory, optional and custom parameters. | public static void | initializeInlineFeatureLayer(GetMapRequest getMapRequest, UserLayer ul, MapLayerInfo currLayer) Method to initialize a user layer which contains inline features. | public boolean | isStylesRquired() | protected Envelope | parseBbox(String bboxParam) | protected void | parseFilterParam(GetMapRequest request) | public static List | parseLayerGroup(String layerGroup) Parses a list of layers in a layer grouping.
Parameters: layerGroup - The layer group. | protected void | parseLayersAndStyles(GetMapRequest request) | protected MapLayerInfo[] | parseLayersParam(GetMapRequest request) Parses the requested layers given by the LAYERS request parameter and
looks up their corresponding FeatureTypeInfo objects in the server. | public void | parseMandatoryParameters(GetMapRequest request, boolean parseStylesLayers) | public void | parseOptionalParameters(GetMapRequest request) | protected void | parseSldBodyParam(GetMapRequest request) Takes the SLD_BODY parameter value and parses it to a geotools'
StyledLayerDescriptor , then takes the layers and styles
to use in the map composition from there. | protected void | parseSldParam(GetMapRequest request) | protected List | parseStylesParam(GetMapRequest request, MapLayerInfo[] layers) Parses the list of style names requested for each requested layer and
looks up the actual Style objects, which are returned in an ordered list.
A client _may_ request teh default Style using a null value (as in
"STYLES="). | public void | setStylesRequired(boolean parseStyles) |
GetMapKvpReader | public GetMapKvpReader(Map kvpPairs, WMService service)(Code) | | Creates a new GetMapKvpReader object.
Parameters: kvpPairs - Key Values pairs of the request Parameters: service - The service handling the request |
addStyles | public static void addStyles(GetMapRequest request, MapLayerInfo currLayer, StyledLayer layer, List layers, List styles) throws WmsException(Code) | | the correct thing to do its grab the style from styledLayers[i] inside
the styledLayers[i] will either be : a) nothing - in which case grab the
layer's default style b) a set of: i) NameStyle -- grab it from the
pre-loaded styles ii)UserStyle -- grab it from the sld the user uploaded
NOTE: we're going to get a set of layer->style pairs for (b). these are
added to layers,styles
NOTE: we also handle some featuretypeconstraints
Parameters: request - Parameters: currLayer - Parameters: layer - Parameters: layers - Parameters: styles - |
filterBaseMap | public void filterBaseMap(Map layers, Map styles)(Code) | | Filters the layers and styles if the user specified "layers=basemap".
Parameters: layers - Parameters: styles - |
findStyle | public static Style findStyle(GetMapRequest request, String currStyleName)(Code) | | DOCUMENT ME!
Parameters: request - Parameters: currStyleName - the configured style named currStyleName ornull if such a style does not exists on thisserver. |
fixURL | static String fixURL(String url)(Code) | | URLEncoder.encode does not respect the RFC 2396, so we rolled our own
little encoder. It's not complete, but should work in most cases
Parameters: url - |
getRequest | public Request getRequest(HttpServletRequest httpRequest) throws ServiceException(Code) | | Produces a GetMapRequest instance by parsing the GetMap
mandatory, optional and custom parameters.
Parameters: httpRequest - the servlet request who's application object holds the serverconfiguration a GetMapRequest completely setted up upon theparameters passed to this reader throws: ServiceException - DOCUMENT ME! |
initializeInlineFeatureLayer | public static void initializeInlineFeatureLayer(GetMapRequest getMapRequest, UserLayer ul, MapLayerInfo currLayer) throws Exception(Code) | | Method to initialize a user layer which contains inline features.
Parameters: request - The request Parameters: mapLayer - The map layer. throws: Exception - |
isStylesRquired | public boolean isStylesRquired()(Code) | | DOCUMENT ME!
DOCUMENT ME! |
parseFilterParam | protected void parseFilterParam(GetMapRequest request) throws WmsException(Code) | | Gets a sequence of url encoded filters and parses them into Filter
objects that will be set into the request object
Parameters: request - throws: WmsException - |
parseLayerGroup | public static List parseLayerGroup(String layerGroup)(Code) | | Parses a list of layers in a layer grouping.
Parameters: layerGroup - The layer group. List of String. |
parseLayersParam | protected MapLayerInfo[] parseLayersParam(GetMapRequest request) throws WmsException(Code) | | Parses the requested layers given by the LAYERS request parameter and
looks up their corresponding FeatureTypeInfo objects in the server.
Parameters: request - throws: WmsException - |
parseMandatoryParameters | public void parseMandatoryParameters(GetMapRequest request, boolean parseStylesLayers) throws WmsException(Code) | | Parses the mandatory GetMap request parameters:
Mandatory parameters:
- LAYERS
- STYLES ommited if SLD or SLD_BODY parameters are supplied
- BBOX
- FORMAT
- WIDTH
- HEIGHT
Parameters: request - DOCUMENT ME! throws: WmsException - DOCUMENT ME! |
parseOptionalParameters | public void parseOptionalParameters(GetMapRequest request) throws WmsException(Code) | | Parses the optional parameters:
- SRS
- TRANSPARENT
- EXCEPTIONS
- BGCOLOR
Parameters: request - DOCUMENT ME! throws: WmsException - DOCUMENT ME! |
parseSldBodyParam | protected void parseSldBodyParam(GetMapRequest request) throws WmsException(Code) | | Takes the SLD_BODY parameter value and parses it to a geotools'
StyledLayerDescriptor , then takes the layers and styles
to use in the map composition from there.
Parameters: request - DOCUMENT ME! throws: WmsException - DOCUMENT ME! |
parseStylesParam | protected List parseStylesParam(GetMapRequest request, MapLayerInfo[] layers) throws WmsException(Code) | | Parses the list of style names requested for each requested layer and
looks up the actual Style objects, which are returned in an ordered list.
A client _may_ request teh default Style using a null value (as in
"STYLES="). If several layers are requested with a mixture of named and
default styles, the STYLES parameter includes null values between commas
(as in "STYLES=style1,,style2,,"). If all layers are to be shown using
the default style, either the form "STYLES=" or "STYLES=,,," is valid.
Parameters: request - DOCUMENT ME! Parameters: layers - the requested feature types a full List of the style names requested for therequiered layers with no null style names. throws: WmsException - if some of the requested styles does not exist or its numberif greater than zero and distinct of the number of requestedlayers |
setStylesRequired | public void setStylesRequired(boolean parseStyles)(Code) | | Sets wether the STYLES parameter must be parsed
Parameters: parseStyles - |
Methods inherited from org.vfny.geoserver.wms.requests.WmsKvpRequestReader | protected String getRequestVersion()(Code)(Java Doc)
|
|
|