public class TemplatedWMSTileSource extends TMSTileSource implements TemplatedTileSource
Modifier and Type | Field and Description |
---|---|
private static Pattern[] |
ALL_PATTERNS |
private EastNorth |
anchorPosition |
private double[] |
degreesPerTile |
private Map<String,String> |
headers |
private static NumberFormat |
latLonFormat |
private static Pattern |
PATTERN_BBOX |
private static Pattern |
PATTERN_E |
private static Pattern |
PATTERN_HEADER |
private static Pattern |
PATTERN_HEIGHT |
private static Pattern |
PATTERN_N |
private static Pattern |
PATTERN_PARAM |
private static Pattern |
PATTERN_PROJ |
private static Pattern |
PATTERN_S |
private static Pattern |
PATTERN_W |
private static Pattern |
PATTERN_WIDTH |
private static float |
SCALE_DENOMINATOR_ZOOM_LEVEL_1 |
private Set<String> |
serverProjections |
private int[] |
tileXMax |
private int[] |
tileXMin |
private int[] |
tileYMax |
private int[] |
tileYMin |
maxZoom, minZoom
baseUrl, id, name, osmMercator, tileSize
attributionImage, attributionImageURL, attributionLinkURL, attributionText, termsOfUseText, termsOfUseURL
Constructor and Description |
---|
TemplatedWMSTileSource(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 TileXY |
eastNorthToTileXY(EastNorth enPoint,
int zoom) |
int |
getDefaultTileSize() |
private double |
getDegreesPerTile(int zoom) |
Map<String,String> |
getHeaders() |
protected EastNorth |
getTileEastNorth(int x,
int y,
int z) |
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.
|
String |
getTileUrl(int zoom,
int tilex,
int tiley)
Constructs the tile url.
|
int |
getTileXMax(int zoom) |
int |
getTileXMin(int zoom) |
int |
getTileYMax(int zoom) |
int |
getTileYMin(int zoom) |
private void |
handleTemplate() |
private void |
initAnchorPosition(Projection proj) |
void |
initProjection()
Initializes class with current projection in JOSM.
|
void |
initProjection(Projection proj)
Initializes class with projection in JOSM.
|
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) |
ICoordinate |
tileXYToLatLon(int x,
int y,
int zoom) |
ICoordinate |
tileXYToLatLon(Tile tile) |
ICoordinate |
tileXYToLatLon(TileXY xy,
int zoom) |
ICoordinate |
xyToLatLon(int x,
int y,
int zoom) |
ICoordinate |
xyToLatLon(Point point,
int zoom) |
getMaxZoom, getMinZoom
getBaseUrl, getDistance, getExtension, getId, getMetadata, getName, getTilePath, getTileSize, 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
getDistance, getId, getMaxZoom, getMetadata, getMinZoom, getName, getTileSize, isNoTileAtZoom
getAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution
private final Set<String> serverProjections
private EastNorth anchorPosition
private int[] tileXMin
private int[] tileYMin
private int[] tileXMax
private int[] tileYMax
private double[] degreesPerTile
private static final Pattern PATTERN_HEADER
private static final Pattern PATTERN_PROJ
private static final Pattern PATTERN_BBOX
private static final Pattern PATTERN_WIDTH
private static final Pattern PATTERN_HEIGHT
private static final Pattern PATTERN_PARAM
private static final NumberFormat latLonFormat
private static final Pattern[] ALL_PATTERNS
private static final float SCALE_DENOMINATOR_ZOOM_LEVEL_1
public TemplatedWMSTileSource(ImageryInfo info)
info
- imagery infopublic void initProjection()
private void initAnchorPosition(Projection proj)
public void initProjection(Projection proj)
proj
- new projection that shall be used for computationspublic int getDefaultTileSize()
getDefaultTileSize
in interface TileSource
getDefaultTileSize
in class AbstractTMSTileSource
public String getTileUrl(int zoom, int tilex, int tiley)
TileSource
getTileUrl
in interface TileSource
getTileUrl
in class AbstractTMSTileSource
zoom
- zoom leveltilex
- X coordinatetiley
- Y coordinatepublic String getTileId(int zoom, int tilex, int tiley)
TileSource
getTileId
in interface TileSource
getTileId
in class AbstractTMSTileSource
zoom
- zoom leveltilex
- X coordinatetiley
- Y coordinatepublic 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 levelprivate TileXY eastNorthToTileXY(EastNorth enPoint, int zoom)
public 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 Point latLonToXY(double lat, double lon, int zoom)
latLonToXY
in interface TileSource
latLonToXY
in class AbstractTMSTileSource
lat
- latitudelon
- longitudezoom
- zoom levelpublic Point latLonToXY(ICoordinate point, int zoom)
latLonToXY
in interface TileSource
latLonToXY
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic ICoordinate xyToLatLon(Point point, int zoom)
xyToLatLon
in interface TileSource
xyToLatLon
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic ICoordinate xyToLatLon(int x, int y, int zoom)
xyToLatLon
in interface TileSource
xyToLatLon
in class AbstractTMSTileSource
x
- X coordinatey
- Y coordinatezoom
- zoom levelpublic Map<String,String> getHeaders()
getHeaders
in interface TemplatedTileSource
public static void checkUrl(String url)
url
- URL to checkprivate void handleTemplate()
protected EastNorth getTileEastNorth(int x, int y, int z)
private double getDegreesPerTile(int zoom)