public abstract class AbstractGetMapRequest extends AbstractWMSRequest implements GetMapRequest
EXCEPTION_XML, hints, onlineResource, properties
BBOX, BGCOLOR, ELEVATION, EXCEPTION_BLANK, EXCEPTION_INIMAGE, EXCEPTION_XML, EXCEPTIONS, FORMAT, HEIGHT, LAYERS, REMOTE_OWS_TYPE, REMOTE_OWS_WCS, REMOTE_OWS_WFS, REMOVE_OWS_URL, SLD, SLD_BODY, SRS, STYLES, TIME, TRANSPARENT, WFS, WIDTH
Constructor and Description |
---|
AbstractGetMapRequest(URL onlineResource,
Properties properties)
Constructs a GetMapRequest.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayer(Layer layer)
Adds a Layer to the list of layers to be requested.
|
void |
addLayer(Layer layer,
String style)
Adds a Layer to the list of layers to be requested.
|
void |
addLayer(Layer layer,
StyleImpl style)
Adds a Layer to the list of layers to be requested.
|
void |
addLayer(String layerName,
String style)
Adds a Layer to the list of layers to be requested.
|
void |
addLayer(String layerName,
StyleImpl style)
Adds a Layer to the list of layers to be requested.
|
URL |
getFinalURL()
Once the properties of the request are configured, this will return the URL that points to
the server and contains all of the appropriate name/value parameters.
|
protected void |
initRequest() |
protected abstract void |
initVersion()
Sets up the version number for this request.
|
protected static boolean |
isGeotoolsLongitudeFirstAxisOrderForced() |
void |
setBBox(Envelope envelope)
Sets BBOX and SRS using the provided Envelope.
|
void |
setBBox(String bbox)
From the Web Map Service Implementation Specification: "The required BBOX parameter allows a
Client to request a particular Bounding Box.
|
void |
setBGColour(String bgColour)
Specifies the colour, in hexidecimal format, to be used as the background of the map.
|
void |
setDimensions(Dimension imageDimension) |
void |
setDimensions(int width,
int height) |
void |
setDimensions(String width,
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(String elevation)
See the Web Map Server Implementation Specification 1.1.1, Annex C, in particular section C.4
|
void |
setExceptions(String exceptions)
The exceptions type specifies what format the server should return exceptions in.
|
void |
setFormat(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(Properties p)
create a request using a properties file to save time
|
void |
setSampleDimensionValue(String name,
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(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(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(String name,
String value)
Used to implement vendor specific parameters.
|
void |
setVersion(String version)
Sets the version number of the request.
|
static CoordinateReferenceSystem |
toServerCRS(String srsName,
boolean forceXY) |
initService
getPostContentType, getProperties, getRequestHints, performPostOutput, processKey, requiresPost, setProperty, setRequestHints
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createResponse, getPostContentType, getProperties, getRequestHints, performPostOutput, requiresPost, setProperty, setRequestHints
public AbstractGetMapRequest(URL onlineResource, Properties properties)
onlineResource
- the location that the request should be applied toproperties
- pre-set properties to be used. Can be null.public URL getFinalURL()
Request
getFinalURL
in interface Request
getFinalURL
in class AbstractRequest
org.geotools.data.wms.request.Request#getFinalURL()
protected abstract void initVersion()
AbstractRequest
initVersion
in class AbstractRequest
protected void initRequest()
initRequest
in class AbstractRequest
public void setVersion(String version)
setVersion
in interface GetMapRequest
version
- A String indicting a WMS Version ("1.0.0", "1.1.0", "1.1.1", or "1.3.0")public void addLayer(Layer layer, String style)
GetMapRequest
addLayer
in interface GetMapRequest
layer
- the Layer to usestyle
- the style to use to draw the layer, can also be NULL, "" or "default"public void addLayer(Layer layer)
GetMapRequest
addLayer
in interface GetMapRequest
layer
- the Layer to usepublic void addLayer(String layerName, String style)
GetMapRequest
addLayer
in interface GetMapRequest
layerName
- the name of the layer to usestyle
- the style to use to draw the layer, can also be NULL, "" or "default"public void addLayer(Layer layer, StyleImpl style)
GetMapRequest
addLayer
in interface GetMapRequest
layer
- the Layer to usestyle
- the style to use. If it is null, the default style is used.public void addLayer(String layerName, StyleImpl style)
GetMapRequest
addLayer
in interface GetMapRequest
layerName
- the Layer to usestyle
- the style to use. If it is null, the default style is used.public void setSRS(String srs)
setSRS
in interface GetMapRequest
srs
- A String indicating the Spatial Reference System to render the layers in.public void setBBox(String bbox)
Yu must also call setSRS to provide the spatial reference system information (or CRS:84 will be assumed)
setBBox
in interface GetMapRequest
bbox
- A string representing a bounding box in the format "minx,miny,maxx,maxy"public static CoordinateReferenceSystem toServerCRS(String srsName, boolean forceXY)
protected static boolean isGeotoolsLongitudeFirstAxisOrderForced()
public void setBBox(Envelope envelope)
setBBox
in interface GetMapRequest
public void setFormat(String format)
setFormat
in interface GetMapRequest
format
- The desired format for the GetMap responsepublic void setDimensions(String width, String height)
setDimensions
in interface GetMapRequest
width
- height
- public void setDimensions(Dimension imageDimension)
setDimensions
in interface GetMapRequest
public void setTransparent(boolean transparent)
setTransparent
in interface GetMapRequest
transparent
- true for transparency, false otherwisepublic void setBGColour(String bgColour)
setBGColour
in interface GetMapRequest
bgColour
- the background colour of the map, in the format 0xRRGGBBpublic void setExceptions(String exceptions)
Valid values are:
setExceptions
in interface GetMapRequest
exceptions
- public void setTime(String time)
setTime
in interface GetMapRequest
time
- See the Web Map Server Implementation Specification 1.1.1, Annexes B and Cpublic void setElevation(String elevation)
setElevation
in interface GetMapRequest
elevation
- See the Web Map Server Implementation Specification 1.1.1, Annex Cpublic void setSampleDimensionValue(String name, String value)
Example use: request.setSampleDimensionValue("DIM_WAVELENGTH",
"4000");
setSampleDimensionValue
in interface GetMapRequest
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)public void setVendorSpecificParameter(String name, String value)
setVendorSpecificParameter
in interface GetMapRequest
name
- a request parameter namevalue
- a value to accompany the namepublic void setDimensions(int width, int height)
setDimensions
in interface GetMapRequest
public void setProperties(Properties p)
GetMapRequest
setProperties
in interface GetMapRequest
Copyright © 1996–2019 Geotools. All rights reserved.