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 String[] |
ALL_PATTERNS |
private double |
crsScale |
private WMTSTileSource.Layer |
currentLayer |
private WMTSTileSource.TileMatrixSet |
currentTileMatrixSet |
private Map<String,String> |
headers |
private Collection<WMTSTileSource.Layer> |
layers |
private static String |
OWS_NS_URL |
private static String |
PATTERN_HEADER |
private WMTSTileSource.TransferMode |
transferMode |
private static String |
URL_GET_ENCODING_PARAMS |
private static String |
WMTS_NS_URL |
private static String |
XLINK_NS_URL |
maxZoom, minZoombaseUrl, id, name, osmMercator, 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(String url)
Checks if url is acceptable by this Tile Source
|
private static String |
crsToCode(String crsIdentifier) |
private Collection<WMTSTileSource.Layer> |
getCapabilities() |
int |
getDefaultTileSize() |
double |
getDistance(double lat1,
double lon1,
double lat2,
double lon2)
Gets the distance using Spherical law of cosines.
|
Map<String,String> |
getHeaders() |
private Collection<WMTSTileSource.Layer> |
getLayers(String name,
String projectionCode) |
int |
getMaxZoom()
Specifies the maximum zoom value.
|
Set<String> |
getSupportedProjections() |
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.
|
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(XMLStreamReader reader)
Parses Operation[@name='GetTile']/DCP/HTTP/Get section.
|
private String |
handleTemplate(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) |
Point |
latLonToXY(double lat,
double lon,
int zoom) |
Point |
latLonToXY(ICoordinate point,
int zoom) |
private static boolean |
moveReaderToTag(XMLStreamReader reader,
QName[] tags)
Moves reader to first occurrence of the structure equivalent of Xpath tags[0]/tags[1]../tags[n].
|
private static String |
normalizeCapabilitiesUrl(String url) |
private static Collection<WMTSTileSource.Layer> |
parseContents(XMLStreamReader reader)
Parse Contents tag.
|
private static WMTSTileSource.Layer |
parseLayer(XMLStreamReader reader)
Parse Layer tag.
|
private void |
parseOperationMetadata(XMLStreamReader reader)
Parses OperationMetadata section.
|
private static WMTSTileSource.TileMatrix |
parseTileMatrix(XMLStreamReader reader,
String matrixCrs)
Parses TileMatrix section.
|
private static WMTSTileSource.TileMatrixSet |
parseTileMatrixSet(XMLStreamReader reader)
Parses TileMatrixSet section.
|
private static String |
praseTileMatrixSetLink(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(Collection<WMTSTileSource.Layer> layers) |
Coordinate |
xyToLatLon(int x,
int y,
int zoom) |
Coordinate |
xyToLatLon(Point point,
int zoom) |
getMinZoomgetBaseUrl, getExtension, getId, getMetadata, getName, getTilePath, isNoTileAtZoom, toStringgetAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution, setAttributionImage, setAttributionImageURL, setAttributionLinkURL, setAttributionText, setTermsOfUseText, setTermsOfUseURLclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetId, getMetadata, getMinZoom, getName, isNoTileAtZoomgetAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttributionprivate static final String PATTERN_HEADER
private static final String URL_GET_ENCODING_PARAMS
private static final String[] ALL_PATTERNS
private static final String OWS_NS_URL
private static final String WMTS_NS_URL
private static final String XLINK_NS_URL
private Collection<WMTSTileSource.Layer> layers
private WMTSTileSource.Layer currentLayer
private WMTSTileSource.TileMatrixSet currentTileMatrixSet
private double crsScale
private WMTSTileSource.TransferMode transferMode
public WMTSTileSource(ImageryInfo info) throws IOException
info - imagery infoIOException - if any I/O error occursprivate WMTSTileSource.Layer userSelectLayer(Collection<WMTSTileSource.Layer> layers)
private String handleTemplate(String url)
private Collection<WMTSTileSource.Layer> getCapabilities() throws IOException
IOExceptionprivate static Collection<WMTSTileSource.Layer> parseContents(XMLStreamReader reader) throws XMLStreamException
reader - StAX reader instanceXMLStreamException - See XMLStreamReaderprivate static WMTSTileSource.Layer parseLayer(XMLStreamReader reader) throws XMLStreamException
reader - StAX reader instanceXMLStreamException - See XMLStreamReaderprivate static String praseTileMatrixSetLink(XMLStreamReader reader) throws XMLStreamException
reader - StAX reader instanceXMLStreamException - See XMLStreamReaderprivate static WMTSTileSource.TileMatrixSet parseTileMatrixSet(XMLStreamReader reader) throws XMLStreamException
reader - StAX reader instanceXMLStreamException - See XMLStreamReaderprivate static WMTSTileSource.TileMatrix parseTileMatrix(XMLStreamReader reader, String matrixCrs) throws XMLStreamException
reader - StAX reader instancematrixCrs - projection used by this matrixXMLStreamException - See XMLStreamReaderprivate void parseOperationMetadata(XMLStreamReader reader) throws XMLStreamException
reader - StAX reader instanceXMLStreamException - See XMLStreamReaderprivate static WMTSTileSource.TransferMode getTransferMode(XMLStreamReader reader) throws XMLStreamException
reader - StAX reader instanceXMLStreamException - See XMLStreamReaderprivate static boolean moveReaderToTag(XMLStreamReader reader, QName[] tags) throws XMLStreamException
reader - StAX reader instancetags - array of tagsXMLStreamException - See XMLStreamReaderprivate static String normalizeCapabilitiesUrl(String url) throws MalformedURLException
MalformedURLExceptionpublic void initProjection(Projection proj)
proj - projection to be used by this TileSourceprivate Collection<WMTSTileSource.Layer> getLayers(String name, String projectionCode)
public int getDefaultTileSize()
getDefaultTileSize in interface TileSourcegetDefaultTileSize in class AbstractTMSTileSourcepublic int getTileSize()
TileSourcegetTileSize in interface TileSourcegetTileSize in class AbstractTMSTileSourcepublic 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 TileSourcegetDistance in class AbstractTMSTileSourcelat1 - 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 TileSourcetileXYToLatLon in class AbstractTMSTileSourcex - X coordinatey - Y coordinatezoom - zoom levelpublic TileXY latLonToTileXY(double lat, double lon, int zoom)
latLonToTileXY in interface TileSourcelatLonToTileXY in class AbstractTMSTileSourcelat - 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 Point latLonToXY(double lat, double lon, int zoom)
latLonToXY in interface TileSourcelatLonToXY in class AbstractTMSTileSourcelat - latitudelon - longitudezoom - zoom levelpublic Point latLonToXY(ICoordinate point, int zoom)
latLonToXY in interface TileSourcelatLonToXY in class AbstractTMSTileSourcepoint - pointzoom - zoom levelpublic Coordinate xyToLatLon(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 TileSourcexyToLatLon in class AbstractTMSTileSourcex - X coordinatey - Y coordinatezoom - zoom levelpublic Map<String,String> getHeaders()
getHeaders in interface TemplatedTileSourcepublic int getMaxZoom()
TileSourceTileSource.getMaxZoom()].getMaxZoom in interface TileSourcegetMaxZoom in class TMSTileSourceJMapViewer.MAX_ZOOMpublic String getTileId(int zoom, int tilex, int tiley)
TileSourcegetTileId in interface TileSourcegetTileId in class AbstractTMSTileSourcezoom - zoom leveltilex - X coordinatetiley - Y coordinatepublic static void checkUrl(String url)
url - URL to checkpublic Set<String> getSupportedProjections()
private int getTileYMax(int zoom, Projection proj)
private int getTileXMax(int zoom, Projection proj)