public class WMTSTileSource extends AbstractTMSTileSource implements TemplatedTileSource
| Modifier and Type | Class and Description |
|---|---|
private static class |
WMTSTileSource.Layer |
private static class |
WMTSTileSource.SelectLayerDialog |
private static class |
WMTSTileSource.TileMatrix |
private static class |
WMTSTileSource.TileMatrixSet |
private static class |
WMTSTileSource.TileMatrixSetBuilder |
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String[] |
ALL_PATTERNS |
private double |
crsScale |
private WMTSTileSource.Layer |
currentLayer |
private WMTSTileSource.TileMatrixSet |
currentTileMatrixSet |
private WMTSDefaultLayer |
defaultLayer |
private java.util.Map<java.lang.String,java.lang.String> |
headers |
private java.util.Collection<WMTSTileSource.Layer> |
layers |
private NativeScaleLayer.ScaleList |
nativeScaleList |
private static java.lang.String |
PATTERN_HEADER |
private static javax.xml.namespace.QName |
QN_CONTENTS |
private static javax.xml.namespace.QName |
QN_FORMAT |
private static javax.xml.namespace.QName |
QN_LAYER |
private static javax.xml.namespace.QName |
QN_MATRIX_HEIGHT |
private static javax.xml.namespace.QName |
QN_MATRIX_WIDTH |
private static javax.xml.namespace.QName |
QN_RESOURCE_URL |
private static javax.xml.namespace.QName |
QN_SCALE_DENOMINATOR |
private static javax.xml.namespace.QName |
QN_STYLE |
private static javax.xml.namespace.QName |
QN_TILE_HEIGHT |
private static javax.xml.namespace.QName |
QN_TILE_WIDTH |
private static javax.xml.namespace.QName |
QN_TILEMATRIX |
private static javax.xml.namespace.QName |
QN_TILEMATRIX_SET_LINK |
private static javax.xml.namespace.QName |
QN_TILEMATRIXSET |
private static javax.xml.namespace.QName |
QN_TOPLEFT_CORNER |
private GetCapabilitiesParseHelper.TransferMode |
transferMode |
private static java.lang.String |
URL_GET_ENCODING_PARAMS |
static java.lang.String |
WMTS_NS_URL
WMTS namespace address
|
baseUrl, id, name, tileSizeattributionImage, attributionImageURL, attributionLinkURL, attributionText, termsOfUseText, termsOfUseURL| Constructor and Description |
|---|
WMTSTileSource(ImageryInfo info)
Creates a tile source based on imagery info
|
| Modifier and Type | Method and Description |
|---|---|
static void |
checkUrl(java.lang.String url)
Checks if url is acceptable by this Tile Source
|
private java.util.Collection<WMTSTileSource.Layer> |
getCapabilities() |
double |
getDistance(double lat1,
double lon1,
double lat2,
double lon2)
Gets the distance using Spherical law of cosines.
|
java.util.Map<java.lang.String,java.lang.String> |
getHeaders() |
private java.util.Collection<WMTSTileSource.Layer> |
getLayers(WMTSDefaultLayer searchLayer,
java.lang.String projectionCode) |
int |
getMaxZoom()
Specifies the maximum zoom value.
|
NativeScaleLayer.ScaleList |
getNativeScales()
Get native scales of tile source.
|
java.util.Set<java.lang.String> |
getSupportedProjections() |
java.lang.String |
getTileId(int zoom,
int tilex,
int tiley)
Creates tile identifier that is unique among all tile sources, but the same tile will always
get the same identifier.
|
private WMTSTileSource.TileMatrix |
getTileMatrix(int zoom) |
int |
getTileSize()
Specifies how large each tile is.
|
java.lang.String |
getTileUrl(int zoom,
int tilex,
int tiley)
Constructs the tile url.
|
int |
getTileXMax(int zoom) |
private int |
getTileXMax(int zoom,
Projection proj) |
int |
getTileXMin(int zoom) |
int |
getTileYMax(int zoom) |
private int |
getTileYMax(int zoom,
Projection proj) |
int |
getTileYMin(int zoom) |
private static java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<WMTSTileSource.Layer>>> |
groupLayersByName(java.util.Collection<WMTSTileSource.Layer> layers) |
private java.lang.String |
handleTemplate(java.lang.String url) |
void |
initProjection(Projection proj)
Initializes projection for this TileSource with projection
|
TileXY |
latLonToTileXY(double lat,
double lon,
int zoom) |
TileXY |
latLonToTileXY(ICoordinate point,
int zoom) |
java.awt.Point |
latLonToXY(double lat,
double lon,
int zoom) |
java.awt.Point |
latLonToXY(ICoordinate point,
int zoom) |
private static java.util.Collection<WMTSTileSource.Layer> |
parseContents(javax.xml.stream.XMLStreamReader reader)
Parse Contents tag.
|
private static WMTSTileSource.Layer |
parseLayer(javax.xml.stream.XMLStreamReader reader)
Parse Layer tag.
|
private void |
parseOperationMetadata(javax.xml.stream.XMLStreamReader reader)
Parses OperationMetadata section.
|
private static WMTSTileSource.TileMatrix |
parseTileMatrix(javax.xml.stream.XMLStreamReader reader,
java.lang.String matrixCrs)
Parses TileMatrix section.
|
private static WMTSTileSource.TileMatrixSet |
parseTileMatrixSet(javax.xml.stream.XMLStreamReader reader)
Parses TileMatrixSet section.
|
private static java.lang.String |
praseTileMatrixSetLink(javax.xml.stream.XMLStreamReader reader)
Gets TileMatrixSetLink value.
|
ICoordinate |
tileXYToLatLon(int x,
int y,
int zoom) |
ICoordinate |
tileXYToLatLon(Tile tile) |
ICoordinate |
tileXYToLatLon(TileXY xy,
int zoom) |
DefaultLayer |
userSelectLayer()
Creates a dialog based on this tile source with all available layers and returns the name of selected layer
|
Coordinate |
xyToLatLon(int x,
int y,
int zoom) |
Coordinate |
xyToLatLon(java.awt.Point point,
int zoom) |
getBaseUrl, getDefaultTileSize, getExtension, getId, getMetadata, getMinZoom, getName, getTilePath, isNoTileAtZoom, toStringgetAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution, setAttributionImage, setAttributionImageURL, setAttributionLinkURL, setAttributionText, setTermsOfUseText, setTermsOfUseURLclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDefaultTileSize, getId, getMetadata, getMinZoom, getName, isNoTileAtZoomgetAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttributionpublic static final java.lang.String WMTS_NS_URL
private static final javax.xml.namespace.QName QN_CONTENTS
private static final javax.xml.namespace.QName QN_FORMAT
private static final javax.xml.namespace.QName QN_LAYER
private static final javax.xml.namespace.QName QN_MATRIX_WIDTH
private static final javax.xml.namespace.QName QN_MATRIX_HEIGHT
private static final javax.xml.namespace.QName QN_RESOURCE_URL
private static final javax.xml.namespace.QName QN_SCALE_DENOMINATOR
private static final javax.xml.namespace.QName QN_STYLE
private static final javax.xml.namespace.QName QN_TILEMATRIX
private static final javax.xml.namespace.QName QN_TILEMATRIXSET
private static final javax.xml.namespace.QName QN_TILEMATRIX_SET_LINK
private static final javax.xml.namespace.QName QN_TILE_WIDTH
private static final javax.xml.namespace.QName QN_TILE_HEIGHT
private static final javax.xml.namespace.QName QN_TOPLEFT_CORNER
private static final java.lang.String PATTERN_HEADER
private static final java.lang.String URL_GET_ENCODING_PARAMS
private static final java.lang.String[] ALL_PATTERNS
private final java.util.Map<java.lang.String,java.lang.String> headers
private final java.util.Collection<WMTSTileSource.Layer> layers
private WMTSTileSource.Layer currentLayer
private WMTSTileSource.TileMatrixSet currentTileMatrixSet
private double crsScale
private GetCapabilitiesParseHelper.TransferMode transferMode
private NativeScaleLayer.ScaleList nativeScaleList
private final WMTSDefaultLayer defaultLayer
public WMTSTileSource(ImageryInfo info) throws java.io.IOException
info - imagery infojava.io.IOException - if any I/O error occursjava.lang.IllegalArgumentException - if any other error happens for the given imagery infopublic DefaultLayer userSelectLayer()
private java.lang.String handleTemplate(java.lang.String url)
private static java.util.List<java.util.Map.Entry<java.lang.String,java.util.List<WMTSTileSource.Layer>>> groupLayersByName(java.util.Collection<WMTSTileSource.Layer> layers)
private java.util.Collection<WMTSTileSource.Layer> getCapabilities() throws java.io.IOException
java.io.IOException - in case of any I/O errorjava.lang.IllegalArgumentException - in case of any other errorprivate static java.util.Collection<WMTSTileSource.Layer> parseContents(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancejavax.xml.stream.XMLStreamException - See XMLStreamReaderprivate static WMTSTileSource.Layer parseLayer(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancejavax.xml.stream.XMLStreamException - See XMLStreamReaderprivate static java.lang.String praseTileMatrixSetLink(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancejavax.xml.stream.XMLStreamException - See XMLStreamReaderprivate static WMTSTileSource.TileMatrixSet parseTileMatrixSet(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancejavax.xml.stream.XMLStreamException - See XMLStreamReaderprivate static WMTSTileSource.TileMatrix parseTileMatrix(javax.xml.stream.XMLStreamReader reader, java.lang.String matrixCrs) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancematrixCrs - projection used by this matrixjavax.xml.stream.XMLStreamException - See XMLStreamReaderprivate void parseOperationMetadata(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancejavax.xml.stream.XMLStreamException - See XMLStreamReaderpublic void initProjection(Projection proj)
proj - projection to be used by this TileSourceprivate java.util.Collection<WMTSTileSource.Layer> getLayers(WMTSDefaultLayer searchLayer, java.lang.String projectionCode)
searchLayer - which layer do we look forprojectionCode - projection code to matchpublic int getTileSize()
TileSourcegetTileSize in interface TileSourcegetTileSize in class AbstractTMSTileSourcepublic java.lang.String getTileUrl(int zoom, int tilex, int tiley)
TileSourcegetTileUrl in interface TileSourcegetTileUrl in class AbstractTMSTileSourcezoom - zoom leveltilex - X coordinatetiley - Y coordinateprivate WMTSTileSource.TileMatrix getTileMatrix(int zoom)
zoom - zoom levelpublic double getDistance(double lat1, double lon1, double lat2, double lon2)
TileSourcegetDistance in interface TileSourcelat1 - latitude of first pointlon1 - longitude of first pointlat2 - latitude of second pointlon2 - longitude of second pointpublic ICoordinate tileXYToLatLon(Tile tile)
tileXYToLatLon in interface TileSourcetileXYToLatLon in class AbstractTMSTileSourcetile - Tilepublic ICoordinate tileXYToLatLon(TileXY xy, int zoom)
tileXYToLatLon in interface TileSourcetileXYToLatLon in class AbstractTMSTileSourcexy - X/Y coordinateszoom - zoom levelpublic ICoordinate tileXYToLatLon(int x, int y, int zoom)
tileXYToLatLon in interface TileSourcex - X coordinatey - Y coordinatezoom - zoom levelpublic TileXY latLonToTileXY(double lat, double lon, int zoom)
latLonToTileXY in interface TileSourcelat - latitudelon - longitudezoom - zoom levelpublic TileXY latLonToTileXY(ICoordinate point, int zoom)
latLonToTileXY in interface TileSourcelatLonToTileXY in class AbstractTMSTileSourcepoint - pointzoom - zoom levelpublic int getTileXMax(int zoom)
getTileXMax in interface TileSourcegetTileXMax in class AbstractTMSTileSourcezoom - zoom levelpublic int getTileXMin(int zoom)
getTileXMin in interface TileSourcegetTileXMin in class AbstractTMSTileSourcezoom - zoom levelpublic int getTileYMax(int zoom)
getTileYMax in interface TileSourcegetTileYMax in class AbstractTMSTileSourcezoom - zoom levelpublic int getTileYMin(int zoom)
getTileYMin in interface TileSourcegetTileYMin in class AbstractTMSTileSourcezoom - zoom levelpublic java.awt.Point latLonToXY(double lat, double lon, int zoom)
latLonToXY in interface TileSourcelat - latitudelon - longitudezoom - zoom levelpublic java.awt.Point latLonToXY(ICoordinate point, int zoom)
latLonToXY in interface TileSourcelatLonToXY in class AbstractTMSTileSourcepoint - pointzoom - zoom levelpublic Coordinate xyToLatLon(java.awt.Point point, int zoom)
xyToLatLon in interface TileSourcexyToLatLon in class AbstractTMSTileSourcepoint - pointzoom - zoom levelpublic Coordinate xyToLatLon(int x, int y, int zoom)
xyToLatLon in interface TileSourcex - X coordinatey - Y coordinatezoom - zoom levelpublic java.util.Map<java.lang.String,java.lang.String> getHeaders()
getHeaders in interface TemplatedTileSourcepublic int getMaxZoom()
TileSourceTileSource.getMaxZoom()].getMaxZoom in interface TileSourcegetMaxZoom in class AbstractTMSTileSourceJMapViewer.MAX_ZOOMpublic java.lang.String getTileId(int zoom, int tilex, int tiley)
TileSourcegetTileId in interface TileSourcegetTileId in class AbstractTMSTileSourcezoom - zoom leveltilex - X coordinatetiley - Y coordinatepublic static void checkUrl(java.lang.String url)
url - URL to checkpublic java.util.Set<java.lang.String> getSupportedProjections()
private int getTileYMax(int zoom, Projection proj)
private int getTileXMax(int zoom, Projection proj)
public NativeScaleLayer.ScaleList getNativeScales()
NativeScaleLayer.ScaleList of native scales