org.geotools.data.wms.request
Interface GetMapRequest

All Superinterfaces:
Request
All Known Implementing Classes:
AbstractGetMapRequest

public interface GetMapRequest
extends Request

Construct a WMS getMap request.

Constructs a getMapRequest based on the following property values:

Q: List availableFormats and availableExceptions - why are these here? It looks like they are designed to restrict the values used for SRS, format and exceptions. If so the code never uses them. Q: How constant is the GetMapRequest format across WMS versions? Do we need to generalize here?

Author:
Richard Gould, Refractions Research

Field Summary
static java.lang.String BBOX
          Represents the BBOX parameter
static java.lang.String BGCOLOR
          Represents the BGCOLOR parameter
static java.lang.String ELEVATION
          Represents the ELEVATION parameter
static java.lang.String EXCEPTION_BLANK
          Represents the EXCEPTION_BLANK value
static java.lang.String EXCEPTION_INIMAGE
          Represents the EXCEPTION_INIMAGE value
static java.lang.String EXCEPTION_XML
           
static java.lang.String EXCEPTIONS
          Represents the EXCEPTIONS parameter
static java.lang.String FORMAT
          Represents the FORMAT parameter
static java.lang.String HEIGHT
          Represents the HEIGHT parameter
static java.lang.String LAYERS
          Represents the LAYERS parameter
static java.lang.String REMOTE_OWS_TYPE
          Represents REMOTE_OWS_TYPE parameter
static java.lang.String REMOTE_OWS_WCS
          REMOTE_OWS_WCS indicates WCS as a REMOTE_OWS_TYPE
static java.lang.String REMOTE_OWS_WFS
          REMOTE_OWS_WFS indicates WFS as a REMOTE_OWS_TYPE
static java.lang.String REMOVE_OWS_URL
          Represents REMOTE_OWS_URL parameter
static java.lang.String SLD
          Represents the SLD parameter
static java.lang.String SLD_BODY
          Represents the SLD_BODY parameter
static java.lang.String SRS
          Represents the SRS parameter
static java.lang.String STYLES
          Represents the STYLES parameter
static java.lang.String TIME
          Represents the TIME parameter
static java.lang.String TRANSPARENT
          Represents the TRANSPARENT parameter
static java.lang.String WFS
          Represents the WFS parameter mentioned briefly in 1.1.1
static java.lang.String WIDTH
          Represents the WIDTH parameter
 
Fields inherited from interface org.geotools.data.wms.request.Request
REQUEST, SERVICE, VERSION, WMTVER
 
Method Summary
 void addLayer(Layer layer)
          Adds a Layer to the list of layers to be requested.
 void addLayer(Layer layer, java.lang.String styleName)
          Adds a Layer to the list of layers to be requested.
 void addLayer(Layer layer, org.opengis.layer.Style style)
          Adds a Layer to the list of layers to be requested.
 void addLayer(java.lang.String layerName, java.lang.String styleName)
          Adds a Layer to the list of layers to be requested.
 void addLayer(java.lang.String layerName, org.opengis.layer.Style style)
          Adds a Layer to the list of layers to be requested.
 void setBBox(CRSEnvelope box)
           
 void setBBox(java.lang.String bbox)
          From the Web Map Service Implementation Specification: "The required BBOX parameter allows a Client to request a particular Bounding Box.
 void setBGColour(java.lang.String bgColour)
          Specifies the colour, in hexidecimal format, to be used as the background of the map.
 void setDimensions(int width, int height)
           
 void setDimensions(java.lang.String width, java.lang.String height)
          From the Web Map Service Implementation Specification: "The required WIDTH and HEIGHT parameters specify the size in integer pixels of the map image to be produced.
 void setElevation(java.lang.String elevation)
          See the Web Map Server Implementation Specification 1.1.1, Annex C, in particular section C.4
 void setExceptions(java.lang.String exceptions)
          The exceptions type specifies what format the server should return exceptions in.
 void setFormat(java.lang.String format)
          From the Web Map Service Implementation Specification: "The required FORMAT parameter states the desired format of the response to an operation.
 void setProperties(java.util.Properties p)
          create a request using a properties file to save time
 void setSampleDimensionValue(java.lang.String name, java.lang.String value)
          See the Web Map Server Implementation Specification 1.1.1, Annex C, in particular section C.4.2 Example use: request.setSampleDimensionValue("DIM_WAVELENGTH", "4000");
 void setSRS(java.lang.String srs)
          From the Web Map Service Implementation Specification: "The required SRS parameter states which Spatial Reference System applies to the values in the BBOX parameter.
 void setTime(java.lang.String time)
          See the Web Map Server Implementation Specification 1.1.1, Annexes B and C
 void setTransparent(boolean transparent)
          From the Web Map Service Implementation Specification: "The optional TRANSPARENT parameter specifies whether the map background is to be made transparent or not.
 void setVendorSpecificParameter(java.lang.String name, java.lang.String value)
          Used to implement vendor specific parameters.
 void setVersion(java.lang.String version)
          Sets the version number of the request.
 
Methods inherited from interface org.geotools.data.wms.request.Request
getFinalURL, getProperties, setProperty
 

Field Detail

ELEVATION

public static final java.lang.String ELEVATION
Represents the ELEVATION parameter

See Also:
Constant Field Values

TIME

public static final java.lang.String TIME
Represents the TIME parameter

See Also:
Constant Field Values

EXCEPTIONS

public static final java.lang.String EXCEPTIONS
Represents the EXCEPTIONS parameter

See Also:
Constant Field Values

BGCOLOR

public static final java.lang.String BGCOLOR
Represents the BGCOLOR parameter

See Also:
Constant Field Values

TRANSPARENT

public static final java.lang.String TRANSPARENT
Represents the TRANSPARENT parameter

See Also:
Constant Field Values

WIDTH

public static final java.lang.String WIDTH
Represents the WIDTH parameter

See Also:
Constant Field Values

HEIGHT

public static final java.lang.String HEIGHT
Represents the HEIGHT parameter

See Also:
Constant Field Values

FORMAT

public static final java.lang.String FORMAT
Represents the FORMAT parameter

See Also:
Constant Field Values

BBOX

public static final java.lang.String BBOX
Represents the BBOX parameter

See Also:
Constant Field Values

SRS

public static final java.lang.String SRS
Represents the SRS parameter

See Also:
Constant Field Values

LAYERS

public static final java.lang.String LAYERS
Represents the LAYERS parameter

See Also:
Constant Field Values

STYLES

public static final java.lang.String STYLES
Represents the STYLES parameter

See Also:
Constant Field Values

EXCEPTION_XML

public static final java.lang.String EXCEPTION_XML
See Also:
Constant Field Values

EXCEPTION_INIMAGE

public static final java.lang.String EXCEPTION_INIMAGE
Represents the EXCEPTION_INIMAGE value

See Also:
Constant Field Values

EXCEPTION_BLANK

public static final java.lang.String EXCEPTION_BLANK
Represents the EXCEPTION_BLANK value

See Also:
Constant Field Values

SLD

public static final java.lang.String SLD
Represents the SLD parameter

See Also:
Constant Field Values

SLD_BODY

public static final java.lang.String SLD_BODY
Represents the SLD_BODY parameter

See Also:
Constant Field Values

WFS

public static final java.lang.String WFS
Represents the WFS parameter mentioned briefly in 1.1.1

See Also:
Constant Field Values

REMOTE_OWS_TYPE

public static final java.lang.String REMOTE_OWS_TYPE
Represents REMOTE_OWS_TYPE parameter

See Also:
Constant Field Values

REMOVE_OWS_URL

public static final java.lang.String REMOVE_OWS_URL
Represents REMOTE_OWS_URL parameter

See Also:
Constant Field Values

REMOTE_OWS_WFS

public static final java.lang.String REMOTE_OWS_WFS
REMOTE_OWS_WFS indicates WFS as a REMOTE_OWS_TYPE

See Also:
Constant Field Values

REMOTE_OWS_WCS

public static final java.lang.String REMOTE_OWS_WCS
REMOTE_OWS_WCS indicates WCS as a REMOTE_OWS_TYPE

See Also:
Constant Field Values
Method Detail

setVersion

public void setVersion(java.lang.String version)
Sets the version number of the request.

Parameters:
version - A String indicting a WMS Version ("1.0.0", "1.1.0", "1.1.1", "1.3.0", etc.)

addLayer

public void addLayer(Layer layer,
                     org.opengis.layer.Style style)
Adds a Layer to the list of layers to be requested. This layer will be drawn below any previously added layers.

Parameters:
layer - the Layer to use
style - the style to use. If it is null, the default style is used.

addLayer

public void addLayer(java.lang.String layerName,
                     org.opengis.layer.Style style)
Adds a Layer to the list of layers to be requested. This layer will be drawn below any previously added layers.

Parameters:
style - the style to use. If it is null, the default style is used.

addLayer

public void addLayer(java.lang.String layerName,
                     java.lang.String styleName)
Adds a Layer to the list of layers to be requested. This layer will be drawn below any previously added layers.

Parameters:
layerName - the name of the layer to use
styleName - the style to use to draw the layer, can also be NULL, "" or "default"

addLayer

public void addLayer(Layer layer,
                     java.lang.String styleName)
Adds a Layer to the list of layers to be requested. This layer will be drawn below any previously added layers.

Parameters:
layer - the Layer to use
styleName - the style to use to draw the layer, can also be NULL, "" or "default"

addLayer

public void addLayer(Layer layer)
Adds a Layer to the list of layers to be requested. This layer will be drawn below any previously added layers. The style will be the default one.

Parameters:
layer - the Layer to use

setSRS

public void setSRS(java.lang.String srs)
From the Web Map Service Implementation Specification: "The required SRS parameter states which Spatial Reference System applies to the values in the BBOX parameter. The value of the SRS parameter shall be on of the values defined in the character data section of an <SRS> element defined or inherited by the requested layer. The same SRS applies to all layers in a single request. If the WMS has declared SRS=NONE for a Layer, then the Layer does not have a well-defined spatial reference system and should not be shown in conjunction with other layers. The client shall specify SRS as "none" in the GetMap request and the Server may issue a Service Exception otherwise."

Parameters:
srs - A String indicating the Spatial Reference System to render the layers in.

setBBox

public void setBBox(java.lang.String bbox)
From the Web Map Service Implementation Specification: "The required BBOX parameter allows a Client to request a particular Bounding Box. The value of the BBOX parameter in a GetMap request is a list of comma-separated numbers of the form "minx,miny,maxx,maxy". If the WMS server has declared that a Layer is not subsettable, then the Client shall specify exactly the declared Bounding Box values in the GetMap request and the Server may issue a Service Exception otherwise." NOTE: In WMS 1.3.0, the specification of "EPSG:4326" has the axis swapped, so a request made in 1.1.1 using "minx,miny,maxx,maxy" would use "miny,minx,maxy,maxx" in 1.3.0. Only when using EPSG:4326! Currently it is up to the client to do this on there own. TODO Accept Envelopes and doubles instead of Strings, and perform the 1.3.0 conversion automatically. Also note that not all servers may implement this. Should provide an option to use 1.1.1 format even when using 1.3.0.

Parameters:
bbox - A string representing a bounding box in the format "minx,miny,maxx,maxy"

setBBox

public void setBBox(CRSEnvelope box)

setFormat

public void setFormat(java.lang.String format)
From the Web Map Service Implementation Specification: "The required FORMAT parameter states the desired format of the response to an operation. Supported values for a GetMap request on a WMS instance are listed in one or more <Format> elements in the &;ltRequest><GetMap> element of its Capabilities XML. The entire MIME type string in <Format> is used as the value of the FORMAT parameter."

Parameters:
format - The desired format for the GetMap response

setDimensions

public void setDimensions(java.lang.String width,
                          java.lang.String height)
From the Web Map Service Implementation Specification: "The required WIDTH and HEIGHT parameters specify the size in integer pixels of the map image to be produced. WIDTH specifies the number of pixels to be used between the minimum and maximum X values (inclusive) in the BBOX parameter, while HEIGHT specifies the number of pixels between the minimum and maximum Y values. If the WMS server has declared that a Layer has fixed width and height, then the Client shall specify exactly those WIDTH and HEIGHT values in the GetMap request and the Server may issue a Service Exception otherwise."

Parameters:
width -
height -

setDimensions

public void setDimensions(int width,
                          int height)

setTransparent

public void setTransparent(boolean transparent)
From the Web Map Service Implementation Specification: "The optional TRANSPARENT parameter specifies whether the map background is to be made transparent or not. The default value is false if the parameter is absent from the request."

Parameters:
transparent - true for transparency, false otherwise

setBGColour

public void setBGColour(java.lang.String bgColour)
Specifies the colour, in hexidecimal format, to be used as the background of the map. It is a String representing RGB values in hexidecimal format, prefixed by "0x". The format is: 0xRRGGBB. The default value is 0xFFFFFF (white)

Parameters:
bgColour - the background colour of the map, in the format 0xRRGGBB

setExceptions

public void setExceptions(java.lang.String exceptions)
The exceptions type specifies what format the server should return exceptions in.

Valid values are:

Parameters:
exceptions -

setTime

public void setTime(java.lang.String time)
See the Web Map Server Implementation Specification 1.1.1, Annexes B and C

Parameters:
time - See the Web Map Server Implementation Specification 1.1.1, Annexes B and C

setElevation

public void setElevation(java.lang.String elevation)
See the Web Map Server Implementation Specification 1.1.1, Annex C, in particular section C.4

Parameters:
elevation - See the Web Map Server Implementation Specification 1.1.1, Annex C

setSampleDimensionValue

public void setSampleDimensionValue(java.lang.String name,
                                    java.lang.String value)
See the Web Map Server Implementation Specification 1.1.1, Annex C, in particular section C.4.2

Example use: request.setSampleDimensionValue("DIM_WAVELENGTH", "4000");

Parameters:
name - the request parameter name to set (usually with 'dim_' as prefix)
value - the value of the request parameter (value, interval or comma-separated list)

setVendorSpecificParameter

public void setVendorSpecificParameter(java.lang.String name,
                                       java.lang.String value)
Used to implement vendor specific parameters. Entirely optional.

Parameters:
name - a request parameter name
value - a value to accompany the name

setProperties

public void setProperties(java.util.Properties p)
create a request using a properties file to save time



Copyright © GeoTools. All Rights Reserved.