Package org.geotools.ows.wmts
Class WebMapTileServer
- Object
-
- AbstractOpenWebService<WMTSCapabilities,Layer>
-
- WebMapTileServer
-
public class WebMapTileServer extends AbstractOpenWebService<WMTSCapabilities,Layer>
WebMapTileServer is a class representing a WMTS.It is used to access the Capabilities document and perform requests. It will perform version negotiation automatically and use the highest known version that the server can communicate.
- Author:
- ian, Emanuele Tajariol (etj at geo-solutions dot it)
-
-
Field Summary
-
Fields inherited from class AbstractOpenWebService
capabilities, headers, hints, info, LOGGER, resourceInfo, serverURL, specification, specs
-
-
Constructor Summary
Constructors Constructor Description WebMapTileServer(URL serverURL)
Set up the WebMapTileServer by calling serverURL with the default http client.WebMapTileServer(URL serverURL, HTTPClient httpClient)
Set up the WebMapTileServer by the given serverUrl using the given http client.WebMapTileServer(URL serverURL, HTTPClient httpClient, Map<String,String> headers)
Set up the WebMapTileServer by the given serverUrl, using the http client with additional headers.WebMapTileServer(URL serverURL, HTTPClient httpClient, WMTSCapabilities capabilities)
Set up the WebMapTileServer by the given capabilities, with the given serverURL.WebMapTileServer(URL serverURL, HTTPClient httpClient, WMTSCapabilities capabilities, Map<String,Object> hints)
Set up the WebMapTileServer by the given capabilities, with the given serverURL and additional hints.WebMapTileServer(URL serverURL, WMTSCapabilities capabilities)
Set up the WebMapTileServer by the given capabilities, with the given serverURL.WebMapTileServer(WebMapTileServer delegate)
Set up a WebMapTileServer by the same serverURL, httpClient, capabilities and hints as delegate
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GetFeatureInfoRequest
createGetFeatureInfoRequest(GetTileRequest getmap)
GetTileRequest
createGetTileRequest()
Creates a GetMultiTileRequest.GetTileRequest
createGetTileRequest(boolean multiTile)
Creates a GetTileRequest.protected ServiceInfo
createInfo()
Implemented by a subclass to describe serviceprotected ResourceInfo
createInfo(Layer resource)
WMTSCapabilities
getCapabilities()
Get the getCapabilities document.GeneralBounds
getEnvelope(Layer layer, CoordinateReferenceSystem crs)
WMTSServiceType
getType()
GetFeatureInfoResponse
issueRequest(GetFeatureInfoRequest request)
Set<Tile>
issueRequest(GetTileRequest tileRequest)
Deprecated.- change to tileRequest.getTiles()GetTileResponse
issueRequest(WMTSSpecification.GetSingleTileRequest tileRequest)
The new issueRequest, which gives a GetTileResponse in response for a GetSingleTileRequest.TileMatrixSet
selectMatrixSet(WMTSLayer layer, CoordinateReferenceSystem requestCRS)
Selects the tileMatrixSet that is linked to this layer with the given CRSvoid
setType(WMTSServiceType type)
protected void
setupSpecifications()
Sets up the specifications/versions that this server is capable of communicating with.-
Methods inherited from class AbstractOpenWebService
getHints, getHTTPClient, getInfo, getInfo, internalIssueRequest, issueRequest, negotiateVersion, setHints, setHttpClient, setLoggingLevel
-
-
-
-
Constructor Detail
-
WebMapTileServer
public WebMapTileServer(URL serverURL, HTTPClient httpClient) throws ServiceException, IOException
Set up the WebMapTileServer by the given serverUrl using the given http client.- Parameters:
serverURL
-httpClient
-- Throws:
ServiceException
IOException
-
WebMapTileServer
public WebMapTileServer(URL serverURL, HTTPClient httpClient, Map<String,String> headers) throws ServiceException, IOException
Set up the WebMapTileServer by the given serverUrl, using the http client with additional headers.- Parameters:
serverURL
-httpClient
-headers
-- Throws:
ServiceException
IOException
-
WebMapTileServer
public WebMapTileServer(URL serverURL, WMTSCapabilities capabilities) throws ServiceException, IOException
Set up the WebMapTileServer by the given capabilities, with the given serverURL. Using the default httpClient.- Parameters:
serverURL
-capabilities
-- Throws:
ServiceException
IOException
-
WebMapTileServer
public WebMapTileServer(URL serverURL, HTTPClient httpClient, WMTSCapabilities capabilities) throws ServiceException, IOException
Set up the WebMapTileServer by the given capabilities, with the given serverURL. Using the given httpClient.- Parameters:
serverURL
-httpClient
-capabilities
-- Throws:
ServiceException
IOException
-
WebMapTileServer
public WebMapTileServer(URL serverURL, HTTPClient httpClient, WMTSCapabilities capabilities, Map<String,Object> hints) throws ServiceException, IOException
Set up the WebMapTileServer by the given capabilities, with the given serverURL and additional hints. Using the given http client.- Parameters:
serverURL
-httpClient
-capabilities
-hints
-- Throws:
ServiceException
IOException
-
WebMapTileServer
public WebMapTileServer(URL serverURL) throws IOException, ServiceException
Set up the WebMapTileServer by calling serverURL with the default http client.- Parameters:
serverURL
-- Throws:
IOException
ServiceException
-
WebMapTileServer
public WebMapTileServer(WebMapTileServer delegate) throws ServiceException, IOException
Set up a WebMapTileServer by the same serverURL, httpClient, capabilities and hints as delegate- Parameters:
delegate
-- Throws:
ServiceException
IOException
-
-
Method Detail
-
getCapabilities
public WMTSCapabilities getCapabilities()
Description copied from class:AbstractOpenWebService
Get the getCapabilities document. If there was an error parsing it during creation, it will return null (and it should have thrown an exception during creation).- Specified by:
getCapabilities
in classAbstractOpenWebService<WMTSCapabilities,Layer>
- Returns:
- a Capabilities object, representing the Capabilities of the server
-
createInfo
protected ServiceInfo createInfo()
Description copied from class:AbstractOpenWebService
Implemented by a subclass to describe service- Specified by:
createInfo
in classAbstractOpenWebService<WMTSCapabilities,Layer>
- Returns:
- ServiceInfo
-
createInfo
protected ResourceInfo createInfo(Layer resource)
- Specified by:
createInfo
in classAbstractOpenWebService<WMTSCapabilities,Layer>
-
setupSpecifications
protected void setupSpecifications()
Description copied from class:AbstractOpenWebService
Sets up the specifications/versions that this server is capable of communicating with.- Specified by:
setupSpecifications
in classAbstractOpenWebService<WMTSCapabilities,Layer>
-
issueRequest
@Deprecated public Set<Tile> issueRequest(GetTileRequest tileRequest) throws ServiceException
Deprecated.- change to tileRequest.getTiles()- Throws:
ServiceException
-
issueRequest
public GetTileResponse issueRequest(WMTSSpecification.GetSingleTileRequest tileRequest) throws IOException, ServiceException
The new issueRequest, which gives a GetTileResponse in response for a GetSingleTileRequest.- Throws:
IOException
ServiceException
-
createGetTileRequest
public GetTileRequest createGetTileRequest()
Creates a GetMultiTileRequest.
-
createGetTileRequest
public GetTileRequest createGetTileRequest(boolean multiTile)
Creates a GetTileRequest. Either a GetSingleTileRequest or GetMultiTileRequest.GetSingleTileRequest is either KVP or REST
The url served to GetRestTileRequest is just the serverUrl. The proper templateUrl is found at a later stage.
-
selectMatrixSet
public TileMatrixSet selectMatrixSet(WMTSLayer layer, CoordinateReferenceSystem requestCRS) throws ServiceException
Selects the tileMatrixSet that is linked to this layer with the given CRS- Throws:
ServiceException
-
createGetFeatureInfoRequest
public GetFeatureInfoRequest createGetFeatureInfoRequest(GetTileRequest getmap)
-
issueRequest
public GetFeatureInfoResponse issueRequest(GetFeatureInfoRequest request)
-
setType
public void setType(WMTSServiceType type)
- Parameters:
type
-
-
getType
public WMTSServiceType getType()
-
getEnvelope
public GeneralBounds getEnvelope(Layer layer, CoordinateReferenceSystem crs)
-
-