public class WMTSClientImpl extends java.lang.Object implements WMTSClient
Represents the class with the necessary logic to connect to a OGCWMTS and interpret the data
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
forceChangeAxisOrder |
protected java.lang.String |
hostName |
protected int |
port |
protected java.lang.String |
serviceName |
| Constructor and Description |
|---|
WMTSClientImpl(java.lang.String host)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
connect(boolean override,
ICancellable cancel)
Connects to a server
|
boolean |
connect(ICancellable cancel) |
WMTSStatus |
createStatus()
Creates a
WMTSStatus structure to make a request |
java.io.File |
downloadFile(java.net.URL url,
ICancellable cancel)
Downloads a file
|
void |
getCapabilities(WMTSServerDescription serverDescription,
boolean override,
ICancellable cancel)
One of the three interfaces defined by OGC WMS, it gets the service capabilities
|
java.lang.String |
getFeatureInfo(WMTSStatus status,
int x,
int y,
ICancellable cancel)
It will send a GetFeatureInfo request to the WMTS
Parsing the response and redirecting the info to the WMTS client
|
java.util.List<java.lang.String> |
getFormats(java.lang.String layerTitle)
Gets the list of formats supported by a layer
|
java.lang.String |
getHost() |
WMTSLayer |
getLayer(java.lang.String layerName)
Gets a layer
|
WMTSThemes |
getLayerListAsThemes()
Gets the list of layers as
WMTSThemes. |
java.util.List<WMTSLayer> |
getLayers()
Reads from the WMS Capabilities, the layers available in the service
|
java.io.File |
getLegendGraphic(WMTSLayer layer,
WMTSStyle style,
ICancellable cancel)
Gets the legend graphic of one layer
|
int |
getNumberOfLayers()
Reads from the WMS Capabilities the number if layers available in the service
|
int |
getPort() |
WMTSServiceIdentification |
getServiceIdentification()
Gets the host description
|
java.lang.String |
getServiceName() |
WMTSServiceProviderImpl |
getServiceProvider()
Gets the host description
|
java.lang.String |
getSubtype() |
WMTSThemes |
getThemes()
Gets the list of themes
|
java.io.File |
getTile(java.lang.String url,
ICancellable cancel,
java.io.File file)
Gets a tile downloading using a specific URL, path and file.
|
java.io.File |
getTile(WMTSStatus status,
ICancellable cancel)
One of the three interfaces that OGC WMS defines.
|
java.io.File |
getTile(WMTSStatus status,
ICancellable cancel,
java.io.File file)
Gets a tile downloading using a specific path and file.
|
java.util.List<WMTSTileMatrixSet> |
getTileMatrixSet()
Gets the set of tiles definition
|
java.net.URL |
getTileURL(WMTSStatus status)
Builds the URL to get a tile using a WMTSStatus object
|
java.lang.String |
getType() |
java.lang.String |
getVersion() |
void |
setForceChangeAxisOrder(boolean force)
Sets longitude first in the axis order
|
void |
setHost(java.lang.String _hostName) |
void |
setPort(int _port) |
void |
setServiceName(java.lang.String _serviceName) |
void |
setSubtype(java.lang.String _subtype) |
void |
setType(java.lang.String _type) |
protected java.lang.String hostName
protected int port
protected java.lang.String serviceName
protected boolean forceChangeAxisOrder
public WMTSClientImpl(java.lang.String host)
throws java.net.ConnectException,
java.io.IOException
java.net.ConnectExceptionjava.io.IOExceptionpublic void setForceChangeAxisOrder(boolean force)
setForceChangeAxisOrder in interface WMTSClientforce - public java.lang.String getVersion()
public java.util.List<WMTSLayer> 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 void close()
public java.io.File getTile(java.lang.String url,
ICancellable cancel,
java.io.File file)
throws WMTSException,
ServerErrorException
WMTSClientGets a tile downloading using a specific URL, path and file. This is useful for URL builds from templates
getTile in interface WMTSClientServerErrorExceptionWMTSExceptionpublic java.io.File getTile(WMTSStatus status, ICancellable cancel, java.io.File file) throws WMTSException, ServerErrorException
Gets a tile downloading using a specific path and file.
getTile in interface WMTSClientServerErrorExceptionWMTSExceptionpublic java.io.File getTile(WMTSStatus status, ICancellable cancel) throws WMTSException, ServerErrorException
One of the three interfaces that OGC WMS defines. Request a map.
getTile in interface WMTSClientServerErrorExceptionWMTSExceptionpublic java.net.URL getTileURL(WMTSStatus status) throws java.net.MalformedURLException
getTileURL in interface WMTSClientServerErrorExceptionjava.net.MalformedURLExceptionpublic java.io.File downloadFile(java.net.URL url,
ICancellable cancel)
throws DownloadException
downloadFile in interface WMTSClientDownloadExceptionServerErrorExceptionpublic void getCapabilities(WMTSServerDescription serverDescription, 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 java.lang.String getFeatureInfo(WMTSStatus status, int x, int y, ICancellable cancel)
It will send a GetFeatureInfo request to the WMTS Parsing the response and redirecting the info to the WMTS client
getFeatureInfo in interface WMTSClientpublic java.io.File getLegendGraphic(WMTSLayer layer, WMTSStyle style, ICancellable cancel) throws WMTSException
getLegendGraphic in interface WMTSClientWMTSExceptionpublic boolean connect(boolean override,
ICancellable cancel)
WMTSClientconnect in interface WMTSClientpublic boolean connect(ICancellable cancel)
public java.util.List<java.lang.String> getFormats(java.lang.String layerTitle)
layerTitle - public WMTSServiceIdentification getServiceIdentification()
WMTSClientgetServiceIdentification in interface WMTSClientpublic WMTSServiceProviderImpl getServiceProvider()
WMTSClientgetServiceProvider in interface WMTSClientpublic WMTSThemes getThemes()
getThemes in interface WMTSClientpublic WMTSThemes getLayerListAsThemes()
WMTSClientWMTSThemes. When the server
does not offer themes it is useful to have the same structure as list
of layers.getLayerListAsThemes in interface WMTSClientpublic java.util.List<WMTSTileMatrixSet> getTileMatrixSet()
WMTSClientgetTileMatrixSet in interface WMTSClientpublic WMTSLayer getLayer(java.lang.String layerName)
WMTSClientgetLayer in interface WMTSClientpublic java.lang.String getHost()
getHost in interface WMTSClientpublic void setHost(java.lang.String _hostName)
public int getPort()
public void setPort(int _port)
public java.lang.String getServiceName()
public void setServiceName(java.lang.String _serviceName)
public java.lang.String getType()
public void setType(java.lang.String _type)
public java.lang.String getSubtype()
public void setSubtype(java.lang.String _subtype)
public WMTSStatus createStatus()
WMTSClientWMTSStatus structure to make a requestcreateStatus in interface WMTSClient