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 |
private static class |
WMTSTileSource.TransferMode |
| 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 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 |
OWS_NS_URL |
private static java.lang.String |
PATTERN_HEADER |
private WMTSTileSource.TransferMode |
transferMode |
private static java.lang.String |
URL_GET_ENCODING_PARAMS |
private static java.lang.String |
WMTS_NS_URL |
private static java.lang.String |
XLINK_NS_URL |
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 static java.lang.String |
crsToCode(java.lang.String crsIdentifier) |
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(java.lang.String name,
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 WMTSTileSource.TransferMode |
getTransferMode(javax.xml.stream.XMLStreamReader reader)
Parses Operation[@name='GetTile']/DCP/HTTP/Get section.
|
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 void |
moveReaderToEndCurrentTag(javax.xml.stream.XMLStreamReader reader)
Moves the reader to the closing tag of current tag.
|
private static boolean |
moveReaderToTag(javax.xml.stream.XMLStreamReader reader,
javax.xml.namespace.QName[] tags)
Moves reader to first occurrence of the structure equivalent of Xpath tags[0]/tags[1]../tags[n].
|
private static java.lang.String |
normalizeCapabilitiesUrl(java.lang.String url) |
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) |
private WMTSTileSource.Layer |
userSelectLayer(java.util.Collection<WMTSTileSource.Layer> layers) |
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, requiresAttributionprivate 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 static final java.lang.String OWS_NS_URL
private static final java.lang.String WMTS_NS_URL
private static final java.lang.String XLINK_NS_URL
private final java.util.Map<java.lang.String,java.lang.String> headers
private java.util.Collection<WMTSTileSource.Layer> layers
private WMTSTileSource.Layer currentLayer
private WMTSTileSource.TileMatrixSet currentTileMatrixSet
private double crsScale
private WMTSTileSource.TransferMode transferMode
private NativeScaleLayer.ScaleList nativeScaleList
public WMTSTileSource(ImageryInfo info) throws java.io.IOException
info - imagery infojava.io.IOException - if any I/O error occursprivate WMTSTileSource.Layer userSelectLayer(java.util.Collection<WMTSTileSource.Layer> layers)
private java.lang.String handleTemplate(java.lang.String url)
private java.util.Collection<WMTSTileSource.Layer> getCapabilities()
private 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 void moveReaderToEndCurrentTag(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - XML stream reader positioned on XMLStreamReader.START_ELEMENTjavax.xml.stream.XMLStreamException - when parse exception occursprivate 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 XMLStreamReaderprivate static WMTSTileSource.TransferMode getTransferMode(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancejavax.xml.stream.XMLStreamException - See XMLStreamReaderprivate static boolean moveReaderToTag(javax.xml.stream.XMLStreamReader reader, javax.xml.namespace.QName[] tags) throws javax.xml.stream.XMLStreamException
reader - StAX reader instancetags - array of tagsjavax.xml.stream.XMLStreamException - See XMLStreamReaderprivate static java.lang.String normalizeCapabilitiesUrl(java.lang.String url) throws java.net.MalformedURLException
java.net.MalformedURLExceptionprivate static java.lang.String crsToCode(java.lang.String crsIdentifier)
public void initProjection(Projection proj)
proj - projection to be used by this TileSourceprivate java.util.Collection<WMTSTileSource.Layer> getLayers(java.lang.String name, java.lang.String projectionCode)
name - of the layer to matchprojectionCode - 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