org.gvsig.remoteclient.wms
Class WMSClient

java.lang.Object
  extended by org.gvsig.remoteclient.RemoteClient
      extended by org.gvsig.remoteclient.RasterClient
          extended by org.gvsig.remoteclient.wms.WMSClient
All Implemented Interfaces:
IRasterClient

public class WMSClient
extends RasterClient

Represents the class the with the necessary logic to connect to a OGCWMS and interpretate the data


Field Summary
 
Fields inherited from class org.gvsig.remoteclient.RemoteClient
hostName, port, serviceName
 
Constructor Summary
WMSClient(java.lang.String host)
          Constructor.
 
Method Summary
 void close()
          Does ...
 boolean connect(boolean override, org.gvsig.compat.net.ICancellable cancel)
          Checks the connection to de remote WMS and requests its capabilities.
 boolean connect(org.gvsig.compat.net.ICancellable cancel)
           
 void getCapabilities(WMSStatus status, boolean override, org.gvsig.compat.net.ICancellable cancel)
          One of the three interfaces defined by OGC WMS, it gets the service capabilities
 java.lang.String getExceptionMessage(java.io.File file)
          Returns the exception message if the file is a XML instead of a image.
 java.lang.String getFeatureInfo(WMSStatus status, int x, int y, int featureCount, org.gvsig.compat.net.ICancellable cancel)
          One of the three interfaces defined by the OGC WMS, it gets the information about a feature requested
 java.util.Vector getFormats()
          Gets the image formats available in the Service to retrieve the maps
 java.net.URL getGetMapURL(WMSStatus status, org.gvsig.compat.net.ICancellable cancel)
          Gets the GetMap URL.
 java.util.Vector getInfoFormats()
          Gets the information by point formats available in the Service
 WMSLayer getLayer(java.lang.String _name)
          Gets the WMSLayer with this name
 java.lang.String[] getLayerNames()
           
 java.util.TreeMap getLayers()
           Reads from the WMS Capabilities, the layers available in the service
 java.awt.geom.Rectangle2D getLayersExtent(java.lang.String[] layerNames, java.lang.String srs)
          Returns the max extent that envolves the requested layers
 WMSLayer getLayersRoot()
           
 java.lang.String[] getLayerTitles()
           
 java.io.File getLegendGraphic(WMSStatus status, java.lang.String layerName, org.gvsig.compat.net.ICancellable cancel)
          One of the three interfaces defined by the OGC WMS, it gets legend of a layer
 java.io.File getMap(WMSStatus status, org.gvsig.compat.net.ICancellable cancel)
          One of the three interfaces that OGC WMS defines.
 int getNumberOfLayers()
          Reads from the WMS Capabilities the number if layers available in the service
 WMSLayer getRootLayer()
           
 WMSServiceInformation getServiceInformation()
          Gets the Service information included in the Capabilities
 java.lang.String getVersion()
           
 boolean hasLegendGraphic()
           
 boolean isQueryable()
           
 
Methods inherited from class org.gvsig.remoteclient.RemoteClient
getHost, getPort, getServiceName, getSubtype, getType, setHost, setPort, setServiceName, setSubtype, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WMSClient

public WMSClient(java.lang.String host)
          throws java.net.ConnectException,
                 java.io.IOException
Constructor. the parameter host, indicates the WMS host to connect.

Throws:
java.net.ConnectException
java.io.IOException
Method Detail

close

public void close()
Description copied from class: RemoteClient

Does ...

Specified by:
close in class RemoteClient

connect

public boolean connect(boolean override,
                       org.gvsig.compat.net.ICancellable cancel)

Checks the connection to de remote WMS and requests its capabilities.

Specified by:
connect in class RemoteClient
Parameters:
override, - if true the previous downloaded data will be overridden

connect

public boolean connect(org.gvsig.compat.net.ICancellable cancel)

getCapabilities

public void getCapabilities(WMSStatus status,
                            boolean override,
                            org.gvsig.compat.net.ICancellable cancel)

One of the three interfaces defined by OGC WMS, it gets the service capabilities

Parameters:
override, - if true the previous downloaded data will be overridden

getExceptionMessage

public java.lang.String getExceptionMessage(java.io.File file)
                                     throws java.io.IOException
Returns the exception message if the file is a XML instead of a image.

Parameters:
file -
Returns:
Throws:
java.io.IOException

getFeatureInfo

public java.lang.String getFeatureInfo(WMSStatus status,
                                       int x,
                                       int y,
                                       int featureCount,
                                       org.gvsig.compat.net.ICancellable cancel)
                                throws WMSException

One of the three interfaces defined by the OGC WMS, it gets the information about a feature requested

Returns:
Throws:
WMSException

getFormats

public java.util.Vector getFormats()

Gets the image formats available in the Service to retrieve the maps

Returns:
a vector with all the available formats

getGetMapURL

public java.net.URL getGetMapURL(WMSStatus status,
                                 org.gvsig.compat.net.ICancellable cancel)
                          throws WMSException,
                                 ServerErrorException

Gets the GetMap URL. The final client should download the file

Throws:
ServerErrorException
WMSException

getInfoFormats

public java.util.Vector getInfoFormats()

Gets the information by point formats available in the Service

Returns:
a vector with all the available formats

getLayer

public WMSLayer getLayer(java.lang.String _name)

Gets the WMSLayer with this name

Parameters:
_name, - layer name
Returns:
the layer with this name

getLayerNames

public java.lang.String[] getLayerNames()

getLayers

public java.util.TreeMap getLayers()

Reads from the WMS Capabilities, the layers available in the service

Returns:
a TreeMap with the available layers in the WMS

getLayersExtent

public java.awt.geom.Rectangle2D getLayersExtent(java.lang.String[] layerNames,
                                                 java.lang.String srs)
Returns the max extent that envolves the requested layers


getLayersRoot

public WMSLayer getLayersRoot()

getLayerTitles

public java.lang.String[] getLayerTitles()

getLegendGraphic

public java.io.File getLegendGraphic(WMSStatus status,
                                     java.lang.String layerName,
                                     org.gvsig.compat.net.ICancellable cancel)
                              throws WMSException,
                                     ServerErrorException

One of the three interfaces defined by the OGC WMS, it gets legend of a layer

Returns:
Throws:
WMSException
ServerErrorException

getMap

public java.io.File getMap(WMSStatus status,
                           org.gvsig.compat.net.ICancellable cancel)
                    throws WMSException,
                           ServerErrorException

One of the three interfaces that OGC WMS defines. Request a map.

Throws:
ServerErrorException
WMSException

getNumberOfLayers

public int getNumberOfLayers()

Reads from the WMS Capabilities the number if layers available in the service


getRootLayer

public WMSLayer getRootLayer()
Returns:
Returns the rootLayer.

getServiceInformation

public WMSServiceInformation getServiceInformation()
Gets the Service information included in the Capabilities


getVersion

public java.lang.String getVersion()

hasLegendGraphic

public boolean hasLegendGraphic()

isQueryable

public boolean isQueryable()


Copyright © 2014 gvSIG Association. All Rights Reserved.