public class WMSClient extends RasterClient
Represents the class the with the necessary logic to connect to a OGCWMS and interpretate the data
hostName, port, serviceName
Modifier and Type | Method and Description |
---|---|
void |
close()
Does ...
|
boolean |
connect(boolean override,
ICancellable cancel)
Deprecated.
Use
connect(WMSStatus, boolean, ICancellable) instead,
as the WMSStatus is necessary when connecting in order to correct
call the getCapabilities method. |
boolean |
connect(ICancellable cancel) |
boolean |
connect(WMSStatus status,
boolean override,
ICancellable cancel)
Checks the connection to the remote WMS and requests its capabilities.
|
void |
getCapabilities(WMSStatus status,
boolean override,
ICancellable cancel)
One of the three interfaces defined by OGC WMS, it gets the service capabilities
|
String |
getExceptionMessage(File file)
Returns the exception message if the file is a XML instead of a image.
|
String |
getFeatureInfo(WMSStatus status,
int x,
int y,
int featureCount,
ICancellable cancel)
One of the three interfaces defined by the OGC WMS, it gets the information about a feature requested
|
Vector |
getFormats()
Gets the image formats available in the Service to retrieve the maps
|
URL |
getGetMapURL(WMSStatus status,
ICancellable cancel)
Gets the GetMap URL.
|
Vector |
getInfoFormats()
Gets the information by point formats available in the Service
|
WMSLayer |
getLayer(String _name)
Gets the WMSLayer with this name
|
String[] |
getLayerNames() |
TreeMap |
getLayers()
Reads from the WMS Capabilities, the layers available in the service
|
Rectangle2D |
getLayersExtent(String[] layerNames,
String srs)
Returns the max extent that envolves the requested layers
|
WMSLayer |
getLayersRoot() |
String[] |
getLayerTitles() |
File |
getLegendGraphic(WMSStatus status,
String layerName,
ICancellable cancel)
One of the three interfaces defined by the OGC WMS, it gets legend of a layer
|
File |
getMap(WMSStatus status,
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
|
String |
getVersion() |
boolean |
hasLegendGraphic() |
boolean |
isQueryable() |
getHost, getPort, getServiceName, getSubtype, getType, setHost, setPort, setServiceName, setSubtype, setType
public WMSClient(String host) throws ConnectException, IOException
ConnectException
IOException
public WMSLayer getRootLayer()
public String getVersion()
public File getMap(WMSStatus status, ICancellable cancel) throws WMSException, ServerErrorException
One of the three interfaces that OGC WMS defines. Request a map.
ServerErrorException
WMSException
public URL getGetMapURL(WMSStatus status, ICancellable cancel) throws WMSException, ServerErrorException
Gets the GetMap URL. The final client should download the file
ServerErrorException
WMSException
public String getExceptionMessage(File file) throws IOException
file
- IOException
public void getCapabilities(WMSStatus status, boolean override, ICancellable cancel)
One of the three interfaces defined by OGC WMS, it gets the service capabilities
override,
- if true the previous downloaded data will be overriddenpublic String getFeatureInfo(WMSStatus status, int x, int y, int featureCount, ICancellable cancel) throws WMSException
One of the three interfaces defined by the OGC WMS, it gets the information about a feature requested
WMSException
public File getLegendGraphic(WMSStatus status, String layerName, ICancellable cancel) throws WMSException, ServerErrorException
One of the three interfaces defined by the OGC WMS, it gets legend of a layer
WMSException
ServerErrorException
public TreeMap getLayers()
Reads from the WMS Capabilities, the layers available in the service
public int getNumberOfLayers()
Reads from the WMS Capabilities the number if layers available in the service
public WMSLayer getLayer(String _name)
Gets the WMSLayer with this name
_name,
- layer namepublic String[] getLayerNames()
public String[] getLayerTitles()
public Vector getFormats()
Gets the image formats available in the Service to retrieve the maps
public Vector getInfoFormats()
Gets the information by point formats available in the Service
public boolean isQueryable()
public boolean hasLegendGraphic()
public void close()
RemoteClient
Does ...
close
in class RemoteClient
public Rectangle2D getLayersExtent(String[] layerNames, String srs)
public WMSServiceInformation getServiceInformation()
public boolean connect(boolean override, ICancellable cancel)
connect(WMSStatus, boolean, ICancellable)
instead,
as the WMSStatus is necessary when connecting in order to correct
call the getCapabilities method.Checks the connection to the remote WMS and requests its capabilities.
connect
in class RemoteClient
override,
- if true the previous downloaded data will be overriddenpublic boolean connect(WMSStatus status, boolean override, ICancellable cancel)
Checks the connection to the remote WMS and requests its capabilities.
This method should probably be moved to RemoteClient interface, as the same problem will probably happen for other protocols
override,
- if true the previous downloaded data will be overriddenpublic WMSLayer getLayersRoot()
public boolean connect(ICancellable cancel)