org.deegree.remoteows.wms
Class WMSClient111

java.lang.Object
  extended by org.deegree.remoteows.wms.WMSClient111
All Implemented Interfaces:
WMSClient

public class WMSClient111
extends Object
implements WMSClient

Allows for easy performing of requests again WMS 1.1.1 compliant map services. TODO refactor timeout and tiled request code

Version:
$Revision: 31298 $, $Date: 2011-07-17 15:33:07 +0200 (Sun, 17 Jul 2011) $
Author:
Andreas Schmitz, last edited by: $Author: aschmitz $

Constructor Summary
WMSClient111(URL url)
           
WMSClient111(URL url, int connectionTimeout, int requestTimeout)
           
WMSClient111(URL url, int connectionTimeout, int requestTimeout, String user, String pass)
           
WMSClient111(XMLAdapter capabilities)
           
 
Method Summary
 String getAddress(WMSConstants.WMSRequestType request, boolean get)
           
 Envelope getBoundingBox(String srs, List<String> layers)
           
 Envelope getBoundingBox(String srs, String layer)
           
 LinkedList<String> getCoordinateSystems(String name)
           
 FeatureCollection getFeatureInfo(GetFeatureInfo gfi, Map<String,String> hardParameters)
           
 LinkedList<String> getFormats(WMSConstants.WMSRequestType request)
           
 Envelope getLatLonBoundingBox(List<String> layers)
           
 Envelope getLatLonBoundingBox(String layer)
           
 Tree<LayerMetadata> getLayerTree()
           
 Pair<BufferedImage,String> getMap(GetMap getMap, Map<String,String> hardParameters, int timeout)
           
 Pair<BufferedImage,String> getMap(GetMap getMap, Map<String,String> hardParameters, int timeout, boolean errorsInImage)
           
 List<String> getNamedLayers()
           
 String getSystemId()
           
 boolean hasLayer(String name)
           
 boolean isOperationSupported(WMSConstants.WMSRequestType request)
           
 void refreshCapabilities()
          TODO implement updateSequence handling to improve network performance
 void setMaxMapDimensions(int maxWidth, int maxHeight)
          Sets the maximum map size that the server will process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WMSClient111

public WMSClient111(URL url,
                    int connectionTimeout,
                    int requestTimeout,
                    String user,
                    String pass)
Parameters:
url -
connectionTimeout - default is 5 seconds
requestTimeout - default is 60 seconds
user - http basic username
pass - http basic password

WMSClient111

public WMSClient111(URL url,
                    int connectionTimeout,
                    int requestTimeout)
Parameters:
url -
connectionTimeout - default is 5 seconds
requestTimeout - default is 60 seconds

WMSClient111

public WMSClient111(URL url)
Parameters:
url -

WMSClient111

public WMSClient111(XMLAdapter capabilities)
Parameters:
capabilities -
Method Detail

getSystemId

public String getSystemId()
Returns:
the system id of the capabilities document.

setMaxMapDimensions

public void setMaxMapDimensions(int maxWidth,
                                int maxHeight)
Sets the maximum map size that the server will process. If a larger map is requested, it will be broken down into multiple GetMap requests.

Parameters:
maxWidth - maximum number of pixels in x-direction, or -1 for unrestricted width
maxHeight - maximum number of pixels in y-direction, or -1 for unrestricted height

refreshCapabilities

public void refreshCapabilities()
TODO implement updateSequence handling to improve network performance

Specified by:
refreshCapabilities in interface WMSClient

isOperationSupported

public boolean isOperationSupported(WMSConstants.WMSRequestType request)
Specified by:
isOperationSupported in interface WMSClient
Parameters:
request -
Returns:
true, if an according section was found in the capabilities

getFormats

public LinkedList<String> getFormats(WMSConstants.WMSRequestType request)
Specified by:
getFormats in interface WMSClient
Parameters:
request -
Returns:
the image formats defined for the request, or null, if request is not supported

getAddress

public String getAddress(WMSConstants.WMSRequestType request,
                         boolean get)
Specified by:
getAddress in interface WMSClient
Parameters:
request -
get - true means HTTP GET, false means HTTP POST
Returns:
the address, or null, if not defined or request unavailable

hasLayer

public boolean hasLayer(String name)
Specified by:
hasLayer in interface WMSClient
Parameters:
name -
Returns:
true, if the WMS advertises a layer with that name

getCoordinateSystems

public LinkedList<String> getCoordinateSystems(String name)
Specified by:
getCoordinateSystems in interface WMSClient
Parameters:
name -
Returns:
all coordinate system names, also inherited ones

getLatLonBoundingBox

public Envelope getLatLonBoundingBox(String layer)
Specified by:
getLatLonBoundingBox in interface WMSClient
Parameters:
layer -
Returns:
the envelope, or null, if none was found

getLatLonBoundingBox

public Envelope getLatLonBoundingBox(List<String> layers)
Specified by:
getLatLonBoundingBox in interface WMSClient
Parameters:
layers -
Returns:
a merged envelope of all the layer's envelopes

getBoundingBox

public Envelope getBoundingBox(String srs,
                               String layer)
Specified by:
getBoundingBox in interface WMSClient
Parameters:
srs -
layer -
Returns:
the envelope, or null, if none was found

getNamedLayers

public List<String> getNamedLayers()
Specified by:
getNamedLayers in interface WMSClient
Returns:
the names of all layers that have a name

getBoundingBox

public Envelope getBoundingBox(String srs,
                               List<String> layers)
Specified by:
getBoundingBox in interface WMSClient
Parameters:
srs -
layers -
Returns:
the merged envelope, or null, if none was found

getMap

public Pair<BufferedImage,String> getMap(GetMap getMap,
                                         Map<String,String> hardParameters,
                                         int timeout)
                                  throws IOException
Specified by:
getMap in interface WMSClient
Parameters:
hardParameters - parameters to override in the request, may be null
Throws:
IOException

getMap

public Pair<BufferedImage,String> getMap(GetMap getMap,
                                         Map<String,String> hardParameters,
                                         int timeout,
                                         boolean errorsInImage)
                                  throws IOException
Specified by:
getMap in interface WMSClient
Parameters:
hardParameters - parameters to override in the request, may be null
Throws:
IOException

getFeatureInfo

public FeatureCollection getFeatureInfo(GetFeatureInfo gfi,
                                        Map<String,String> hardParameters)
                                 throws IOException
Specified by:
getFeatureInfo in interface WMSClient
Parameters:
hardParameters - parameters to override in the request, may be null
Throws:
IOException

getLayerTree

public Tree<LayerMetadata> getLayerTree()
Specified by:
getLayerTree in interface WMSClient


Copyright © 2011. All Rights Reserved.