Package org.geotools.ows.wmts.client
Class WMTSTileService
- Object
-
- TileService
-
- WMTSTileService
-
- All Implemented Interfaces:
ImageLoader
public class WMTSTileService extends TileService
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
Fields Modifier and Type Field Description static String
EXTRA_HEADERS
protected static Logger
LOGGER
-
Fields inherited from class TileService
cacheSize
-
-
Constructor Summary
Constructors Constructor Description WMTSTileService(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Tile>
findTilesInExtent(ReferencedEnvelope requestedExtent, double scaleFactor, boolean recommendedZoomLevel, int maxNumberOfTiles)
ReferencedEnvelope
getBounds()
Returns the bounds for the complete TileServiceMap<String,Object>
getExtrainfo()
A place to put any Header that should be sent in http calls.TileMatrixSet
getMatrixSet()
TileMatrixSetLink
getMatrixSetLink()
CoordinateReferenceSystem
getProjectedTileCrs()
The projection the tiles are drawn in.protected ReferencedEnvelope
getReqExtentInTileCrs(ReferencedEnvelope requestedExtent)
double[]
getScaleList()
Returns a list that represents a mapping between zoom-levels and map scale.TileFactory
getTileFactory()
Returns the TileFactory which is used to call the method getTileFromCoordinate().TileMatrix
getTileMatrix(int zoomLevel)
WMTSZoomLevel
getZoomLevel(int zoom)
TileIdentifier
identifyTileAtCoordinate(double lon, double lat, ZoomLevel zoomLevel)
Returns tile identifier for the tile at the given coordinateBufferedImage
loadImageTileImage(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 Detail
-
LOGGER
protected static final Logger LOGGER
-
EXTRA_HEADERS
public static final String EXTRA_HEADERS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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
public WMTSTileService(String templateURL, WMTSLayer layer, TileMatrixSet tileMatrixSet)
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
public WMTSTileService(WebMapTileServer wmtsServer, WMTSLayer layer, TileMatrixSet tileMatrixSet)
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 Detail
-
getReqExtentInTileCrs
protected ReferencedEnvelope getReqExtentInTileCrs(ReferencedEnvelope requestedExtent)
-
findTilesInExtent
public Set<Tile> findTilesInExtent(ReferencedEnvelope requestedExtent, double scaleFactor, boolean recommendedZoomLevel, int maxNumberOfTiles)
- Overrides:
findTilesInExtent
in classTileService
-
loadImageTileImage
public BufferedImage loadImageTileImage(Tile tile) throws IOException
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
public ReferencedEnvelope getBounds()
Description copied from class:TileService
Returns the bounds for the complete TileService- Specified by:
getBounds
in classTileService
-
getProjectedTileCrs
public CoordinateReferenceSystem getProjectedTileCrs()
Description copied from class:TileService
The projection the tiles are drawn in.- Specified by:
getProjectedTileCrs
in classTileService
-
getTileFactory
public TileFactory getTileFactory()
Description copied from class:TileService
Returns the TileFactory which is used to call the method getTileFromCoordinate().- Specified by:
getTileFactory
in classTileService
-
getMatrixSetLink
public TileMatrixSetLink getMatrixSetLink()
-
getTileMatrix
public TileMatrix getTileMatrix(int zoomLevel)
-
getMatrixSet
public TileMatrixSet getMatrixSet()
- Returns:
- the matrixSet
-
setMatrixSet
public void setMatrixSet(TileMatrixSet matrixSet)
- Parameters:
matrixSet
- the matrixSet to set
-
getZoomLevel
public WMTSZoomLevel getZoomLevel(int zoom)
-
getExtrainfo
public Map<String,Object> getExtrainfo()
A place to put any Header that should be sent in http calls.- Returns:
-
identifyTileAtCoordinate
public TileIdentifier identifyTileAtCoordinate(double lon, double lat, ZoomLevel zoomLevel)
Description copied from class:TileService
Returns tile identifier for the tile at the given coordinate- Specified by:
identifyTileAtCoordinate
in classTileService
-
-