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.ConnectException
java.io.IOException
public void setForceChangeAxisOrder(boolean force)
setForceChangeAxisOrder
in interface WMTSClient
force
- 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
WMTSClient
Gets a tile downloading using a specific URL, path and file. This is useful for URL builds from templates
getTile
in interface WMTSClient
ServerErrorException
WMTSException
public 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 WMTSClient
ServerErrorException
WMTSException
public 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 WMTSClient
ServerErrorException
WMTSException
public java.net.URL getTileURL(WMTSStatus status) throws java.net.MalformedURLException
getTileURL
in interface WMTSClient
ServerErrorException
java.net.MalformedURLException
public java.io.File downloadFile(java.net.URL url, ICancellable cancel) throws DownloadException
downloadFile
in interface WMTSClient
DownloadException
ServerErrorException
public 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 WMTSClient
public java.io.File getLegendGraphic(WMTSLayer layer, WMTSStyle style, ICancellable cancel) throws WMTSException
getLegendGraphic
in interface WMTSClient
WMTSException
public boolean connect(boolean override, ICancellable cancel)
WMTSClient
connect
in interface WMTSClient
public boolean connect(ICancellable cancel)
public java.util.List<java.lang.String> getFormats(java.lang.String layerTitle)
layerTitle
- public WMTSServiceIdentification getServiceIdentification()
WMTSClient
getServiceIdentification
in interface WMTSClient
public WMTSServiceProviderImpl getServiceProvider()
WMTSClient
getServiceProvider
in interface WMTSClient
public WMTSThemes getThemes()
getThemes
in interface WMTSClient
public WMTSThemes getLayerListAsThemes()
WMTSClient
WMTSThemes
. When the server
does not offer themes it is useful to have the same structure as list
of layers.getLayerListAsThemes
in interface WMTSClient
public java.util.List<WMTSTileMatrixSet> getTileMatrixSet()
WMTSClient
getTileMatrixSet
in interface WMTSClient
public WMTSLayer getLayer(java.lang.String layerName)
WMTSClient
getLayer
in interface WMTSClient
public java.lang.String getHost()
getHost
in interface WMTSClient
public 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()
WMTSClient
WMTSStatus
structure to make a requestcreateStatus
in interface WMTSClient