| java.lang.Object org.geotools.data.ows.AbstractOpenWebService org.geotools.data.wms.WebMapServer
WebMapServer | public class WebMapServer extends AbstractOpenWebService (Code) | | WebMapServer is a class representing a WMS. It is used to access the
Capabilities document and perform requests. It supports multiple versions
and will perform version negotiation automatically and use the highest
known version that the server can communicate.
If restriction of versions to be used is desired, this class should be
subclassed and it's setupSpecifications() method over-ridden. It should
add which version/specifications are to be used to the specs array. See
the current implementation for an example.
Example usage:
WebMapServer wms = new WebMapServer("http://some.example.com/wms");
WMSCapabilities capabilities = wms.getCapabilities();
GetMapRequest request = wms.getMapRequest();
... //configure request
GetMapResponse response = (GetMapResponse) wms.issueRequest(request);
... //extract image from the response
author: Richard Gould, Refractions Research |
Constructor Summary | |
public | WebMapServer(URL serverURL) Creates a new WebMapServer instance and attempts to retrieve the
Capabilities document specified by serverURL. |
WebMapServer | public WebMapServer(URL serverURL) throws IOException, ServiceException(Code) | | Creates a new WebMapServer instance and attempts to retrieve the
Capabilities document specified by serverURL.
Parameters: serverURL - a URL that points to the capabilities document of a server throws: IOException - if there is an error communicating with the server throws: ServiceException - if the server responds with an error |
createGetFeatureInfoRequest | public GetFeatureInfoRequest createGetFeatureInfoRequest(GetMapRequest getMapRequest)(Code) | | Creates a GetFeatureInfoRequest that can be configured and then passed to
issueRequest().
Parameters: getMapRequest - a previous configured GetMapRequest a GetFeatureInfoRequest throws: UnsupportedOperationException - if the server does not support GetFeatureInfo |
createGetMapRequest | public GetMapRequest createGetMapRequest()(Code) | | Creates a GetMapRequest that can be configured and then passed to
issueRequest().
a configureable GetMapRequest object |
getCapabilities | public WMSCapabilities getCapabilities()(Code) | | Get the getCapabilities document. If there was an error parsing it
during creation, it will return null (and it should have thrown an
exception during creation).
a WMSCapabilities object, representing the Capabilities of the server |
getEnvelope | public GeneralEnvelope getEnvelope(Layer layer, CoordinateReferenceSystem crs)(Code) | | Given a layer and a coordinate reference system, will locate an envelope
for that layer in that CRS. If the layer is declared to support that CRS,
but no envelope can be found, it will try to calculate an appropriate
bounding box.
If null is returned, no valid bounding box could be found and one couldn't
be transformed from another.
Parameters: layer - Parameters: crs - an Envelope containing a valid bounding box, or null if none are found |
setupSpecifications | protected void setupSpecifications()(Code) | | Sets up the specifications/versions that this server is capable of
communicating with.
|
|
|