public class WMTSTileSource extends TMSTileSource 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.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 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 |
maxZoom, minZoom
baseUrl, id, name, osmMercator, tileSize
attributionImage, 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() |
int |
getDefaultTileSize() |
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.
|
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 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) |
getMinZoom
getBaseUrl, getExtension, getId, getMetadata, getName, getTilePath, isNoTileAtZoom, toString
getAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution, setAttributionImage, setAttributionImageURL, setAttributionLinkURL, setAttributionText, setTermsOfUseText, setTermsOfUseURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getMetadata, getMinZoom, getName, isNoTileAtZoom
getAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution
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 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
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() throws java.io.IOException
java.io.IOException
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 XMLStreamReader
private static WMTSTileSource.Layer parseLayer(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader
- StAX reader instancejavax.xml.stream.XMLStreamException
- See XMLStreamReader
private static java.lang.String praseTileMatrixSetLink(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader
- StAX reader instancejavax.xml.stream.XMLStreamException
- See XMLStreamReader
private static WMTSTileSource.TileMatrixSet parseTileMatrixSet(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader
- StAX reader instancejavax.xml.stream.XMLStreamException
- See XMLStreamReader
private 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 XMLStreamReader
private void parseOperationMetadata(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader
- StAX reader instancejavax.xml.stream.XMLStreamException
- See XMLStreamReader
private static WMTSTileSource.TransferMode getTransferMode(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader
- StAX reader instancejavax.xml.stream.XMLStreamException
- See XMLStreamReader
private 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 XMLStreamReader
private static java.lang.String normalizeCapabilitiesUrl(java.lang.String url) throws java.net.MalformedURLException
java.net.MalformedURLException
private 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)
public int getDefaultTileSize()
getDefaultTileSize
in interface TileSource
getDefaultTileSize
in class AbstractTMSTileSource
public int getTileSize()
TileSource
getTileSize
in interface TileSource
getTileSize
in class AbstractTMSTileSource
public java.lang.String getTileUrl(int zoom, int tilex, int tiley)
TileSource
getTileUrl
in interface TileSource
getTileUrl
in class AbstractTMSTileSource
zoom
- zoom leveltilex
- X coordinatetiley
- Y coordinateprivate WMTSTileSource.TileMatrix getTileMatrix(int zoom)
zoom
- zoom levelpublic double getDistance(double lat1, double lon1, double lat2, double lon2)
TileSource
getDistance
in interface TileSource
getDistance
in class AbstractTMSTileSource
lat1
- latitude of first pointlon1
- longitude of first pointlat2
- latitude of second pointlon2
- longitude of second pointpublic ICoordinate tileXYToLatLon(Tile tile)
tileXYToLatLon
in interface TileSource
tileXYToLatLon
in class AbstractTMSTileSource
tile
- Tilepublic ICoordinate tileXYToLatLon(TileXY xy, int zoom)
tileXYToLatLon
in interface TileSource
tileXYToLatLon
in class AbstractTMSTileSource
xy
- X/Y coordinateszoom
- zoom levelpublic ICoordinate tileXYToLatLon(int x, int y, int zoom)
tileXYToLatLon
in interface TileSource
tileXYToLatLon
in class AbstractTMSTileSource
x
- X coordinatey
- Y coordinatezoom
- zoom levelpublic TileXY latLonToTileXY(double lat, double lon, int zoom)
latLonToTileXY
in interface TileSource
latLonToTileXY
in class AbstractTMSTileSource
lat
- latitudelon
- longitudezoom
- zoom levelpublic TileXY latLonToTileXY(ICoordinate point, int zoom)
latLonToTileXY
in interface TileSource
latLonToTileXY
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic int getTileXMax(int zoom)
getTileXMax
in interface TileSource
getTileXMax
in class AbstractTMSTileSource
zoom
- zoom levelpublic int getTileXMin(int zoom)
getTileXMin
in interface TileSource
getTileXMin
in class AbstractTMSTileSource
zoom
- zoom levelpublic int getTileYMax(int zoom)
getTileYMax
in interface TileSource
getTileYMax
in class AbstractTMSTileSource
zoom
- zoom levelpublic int getTileYMin(int zoom)
getTileYMin
in interface TileSource
getTileYMin
in class AbstractTMSTileSource
zoom
- zoom levelpublic java.awt.Point latLonToXY(double lat, double lon, int zoom)
latLonToXY
in interface TileSource
latLonToXY
in class AbstractTMSTileSource
lat
- latitudelon
- longitudezoom
- zoom levelpublic java.awt.Point latLonToXY(ICoordinate point, int zoom)
latLonToXY
in interface TileSource
latLonToXY
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic Coordinate xyToLatLon(java.awt.Point point, int zoom)
xyToLatLon
in interface TileSource
xyToLatLon
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic Coordinate xyToLatLon(int x, int y, int zoom)
xyToLatLon
in interface TileSource
xyToLatLon
in class AbstractTMSTileSource
x
- X coordinatey
- Y coordinatezoom
- zoom levelpublic java.util.Map<java.lang.String,java.lang.String> getHeaders()
getHeaders
in interface TemplatedTileSource
public int getMaxZoom()
TileSource
TileSource.getMaxZoom()
].getMaxZoom
in interface TileSource
getMaxZoom
in class TMSTileSource
JMapViewer.MAX_ZOOM
public java.lang.String getTileId(int zoom, int tilex, int tiley)
TileSource
getTileId
in interface TileSource
getTileId
in class AbstractTMSTileSource
zoom
- 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)