public class WMTSClientImpl extends 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 String |
hostName |
protected int |
port |
protected String |
serviceName |
Constructor and Description |
---|
WMTSClientImpl(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 |
File |
downloadFile(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
|
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
|
List<String> |
getFormats(String layerTitle)
Gets the list of formats supported by a layer
|
String |
getHost() |
WMTSLayer |
getLayer(String layerName)
Gets a layer
|
WMTSThemes |
getLayerListAsThemes()
Gets the list of layers as
WMTSThemes . |
List<WMTSLayer> |
getLayers()
Reads from the WMS Capabilities, the layers available in the service
|
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
|
String |
getServiceName() |
WMTSServiceProviderImpl |
getServiceProvider()
Gets the host description
|
String |
getSubtype() |
WMTSThemes |
getThemes()
Gets the list of themes
|
File |
getTile(String url,
ICancellable cancel,
File file)
Gets a tile downloading using a specific URL, path and file.
|
File |
getTile(WMTSStatus status,
ICancellable cancel)
One of the three interfaces that OGC WMS defines.
|
File |
getTile(WMTSStatus status,
ICancellable cancel,
File file)
Gets a tile downloading using a specific path and file.
|
List<WMTSTileMatrixSet> |
getTileMatrixSet()
Gets the set of tiles definition
|
URL |
getTileURL(WMTSStatus status)
Builds the URL to get a tile using a WMTSStatus object
|
String |
getType() |
String |
getVersion() |
void |
setForceChangeAxisOrder(boolean force)
Sets longitude first in the axis order
|
void |
setHost(String _hostName) |
void |
setPort(int _port) |
void |
setServiceName(String _serviceName) |
void |
setSubtype(String _subtype) |
void |
setType(String _type) |
protected String hostName
protected int port
protected String serviceName
protected boolean forceChangeAxisOrder
public WMTSClientImpl(String host) throws ConnectException, IOException
ConnectException
IOException
public void setForceChangeAxisOrder(boolean force)
setForceChangeAxisOrder
in interface WMTSClient
force
- public String getVersion()
public 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 File getTile(String url, ICancellable cancel, 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 File getTile(WMTSStatus status, ICancellable cancel, File file) throws WMTSException, ServerErrorException
Gets a tile downloading using a specific path and file.
getTile
in interface WMTSClient
ServerErrorException
WMTSException
public 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 URL getTileURL(WMTSStatus status) throws MalformedURLException
getTileURL
in interface WMTSClient
ServerErrorException
MalformedURLException
public File downloadFile(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 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 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 List<String> getFormats(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 List<WMTSTileMatrixSet> getTileMatrixSet()
WMTSClient
getTileMatrixSet
in interface WMTSClient
public WMTSLayer getLayer(String layerName)
WMTSClient
getLayer
in interface WMTSClient
public String getHost()
getHost
in interface WMTSClient
public void setHost(String _hostName)
public int getPort()
public void setPort(int _port)
public String getServiceName()
public void setServiceName(String _serviceName)
public String getType()
public void setType(String _type)
public String getSubtype()
public void setSubtype(String _subtype)
public WMTSStatus createStatus()
WMTSClient
WMTSStatus
structure to make a requestcreateStatus
in interface WMTSClient