Package org.geotools.ows.wmts.client
Class WMTSTileService
Object
TileService
WMTSTileService
- All Implemented Interfaces:
ImageLoader
A tile service for a single matrix set of a WMTS servers.
An instance of this class is tied to a single layer, style and matrixset.
It can be constructed either by a templateUrl and use the inherited ImageLoader,
Or it can use a WebMapTileServer to construct the GetTileRequest's and issueRequest for loading images.
- Author:
- ian, Emanuele Tajariol (etj at geo-solutions dot it)
-
Field Summary
FieldsFields inherited from class TileService
cacheSize
-
Constructor Summary
ConstructorsConstructorDescriptionWMTSTileService
(String templateURL, WMTSLayer layer, TileMatrixSet tileMatrixSet) Creates a WMTSTileService based on the templateURL for loading images.WMTSTileService
(String templateURL, WMTSLayer layer, TileMatrixSet tileMatrixSet, HTTPClient client) Create a service that uses the templateURL to load images.WMTSTileService
(String templateURL, WMTSServiceType type, WMTSLayer layer, String styleName, TileMatrixSet tileMatrixSet) Create a service with templateURL for loading images directly.WMTSTileService
(String templateURL, WMTSServiceType type, WMTSLayer layer, String styleName, TileMatrixSet tileMatrixSet, HTTPClient client) Create a service with templateURL for loading images directly.WMTSTileService
(WebMapTileServer wmtsServer, WMTSLayer layer, TileMatrixSet tileMatrixSet) Create a WMTSTileservice using a WebMapTileServer to load the tile images.WMTSTileService
(WebMapTileServer wmtsServer, WMTSLayer layer, TileMatrixSet tileMatrixSet, String format) Create a WMTSTileService using an WebMapTileServer to load the tile images. -
Method Summary
Modifier and TypeMethodDescriptionfindTilesInExtent
(ReferencedEnvelope requestedExtent, double scaleFactor, boolean recommendedZoomLevel, int maxNumberOfTiles) Returns the bounds for the complete TileServiceA place to put any Header that should be sent in http calls.The projection the tiles are drawn in.protected ReferencedEnvelope
getReqExtentInTileCrs
(ReferencedEnvelope requestedExtent) double[]
Returns a list that represents a mapping between zoom-levels and map scale.Returns the TileFactory which is used to call the method getTileFromCoordinate().getTileMatrix
(int zoomLevel) WMTSZoomLevel
getZoomLevel
(int zoom) identifyTileAtCoordinate
(double lon, double lat, ZoomLevel zoomLevel) Returns tile identifier for the tile at the given coordinateloadImageTileImage
(Tile tile) Fetches the image from url given by tile.void
setMatrixSet
(TileMatrixSet matrixSet) Methods inherited from class TileService
createSafeEnvelopeInWGS84, getBaseUrl, getHttpClient, getMaxZoomLevel, getMinZoomLevel, getName, getTileCrs, getTileHeight, getTileWidth, getZoomLevelFromMapScale, getZoomLevelToUse, obtainTile, toString
-
Field Details
-
LOGGER
-
EXTRA_HEADERS
- See Also:
-
-
Constructor Details
-
WMTSTileService
public WMTSTileService(String templateURL, WMTSServiceType type, WMTSLayer layer, String styleName, TileMatrixSet tileMatrixSet) Create a service with templateURL for loading images directly.This constructor, with type as argument, should not be used. A proper formatted templateURL should be used instead.
- Parameters:
templateURL
- - where to ask for tilestype
- - KVP or RESTlayer
- - the layer to requeststyleName
- - name of the style to use?tileMatrixSet
- - the tile matrix set to use
-
WMTSTileService
public WMTSTileService(String templateURL, WMTSServiceType type, WMTSLayer layer, String styleName, TileMatrixSet tileMatrixSet, HTTPClient client) Create a service with templateURL for loading images directly.This constructor, with type, should not be used. A proper formatted templateURL should be used instead.
- Parameters:
templateURL
- - where to ask for tilestype
- - KVP or RESTlayer
- - layer to requeststyleName
- - name of the style to use?tileMatrixSet
- - matrixsetclient
- - HttpClient instance to use for Tile requests.
-
WMTSTileService
Creates a WMTSTileService based on the templateURL for loading images. Using extent given by layer and tileMatrixSet.- Parameters:
templateURL
-layer
-tileMatrixSet
-
-
WMTSTileService
public WMTSTileService(String templateURL, WMTSLayer layer, TileMatrixSet tileMatrixSet, HTTPClient client) Create a service that uses the templateURL to load images.- Parameters:
templateURL
- - where to ask for tileslayer
- - layer to requesttileMatrixSet
- - matrixsetclient
- - HttpClient instance to use for Tile requests.
-
WMTSTileService
Create a WMTSTileservice using a WebMapTileServer to load the tile images. Using the format given by the capabilities. -
WMTSTileService
public WMTSTileService(WebMapTileServer wmtsServer, WMTSLayer layer, TileMatrixSet tileMatrixSet, String format) Create a WMTSTileService using an WebMapTileServer to load the tile images. Specifying a format.
-
-
Method Details
-
getReqExtentInTileCrs
-
findTilesInExtent
public Set<Tile> findTilesInExtent(ReferencedEnvelope requestedExtent, double scaleFactor, boolean recommendedZoomLevel, int maxNumberOfTiles) - Overrides:
findTilesInExtent
in classTileService
-
loadImageTileImage
Description copied from class:TileService
Fetches the image from url given by tile.- Specified by:
loadImageTileImage
in interfaceImageLoader
- Overrides:
loadImageTileImage
in classTileService
- Returns:
- an image
- Throws:
IOException
-
getScaleList
public double[] getScaleList()Description copied from class:TileService
Returns a list that represents a mapping between zoom-levels and map scale.Array index: zoom-level Value at index: map scale High zoom-level -> more detailed map Low zoom-level -> less detailed map
- Specified by:
getScaleList
in classTileService
- Returns:
- mapping between zoom-levels and map scale
-
getBounds
Description copied from class:TileService
Returns the bounds for the complete TileService- Specified by:
getBounds
in classTileService
-
getProjectedTileCrs
Description copied from class:TileService
The projection the tiles are drawn in.- Specified by:
getProjectedTileCrs
in classTileService
-
getTileFactory
Description copied from class:TileService
Returns the TileFactory which is used to call the method getTileFromCoordinate().- Specified by:
getTileFactory
in classTileService
-
getMatrixSetLink
-
getTileMatrix
-
getMatrixSet
- Returns:
- the matrixSet
-
setMatrixSet
- Parameters:
matrixSet
- the matrixSet to set
-
getZoomLevel
public WMTSZoomLevel getZoomLevel(int zoom) -
getExtrainfo
A place to put any Header that should be sent in http calls.- Returns:
-
identifyTileAtCoordinate
Description copied from class:TileService
Returns tile identifier for the tile at the given coordinate- Specified by:
identifyTileAtCoordinate
in classTileService
-