public abstract class AbstractWMSTileSource extends TMSTileSource
Modifier and Type | Field and Description |
---|---|
private EastNorth |
anchorPosition |
private double[] |
degreesPerTile |
(package private) static java.text.NumberFormat |
LATLON_FORMAT |
private static float |
SCALE_DENOMINATOR_ZOOM_LEVEL_1 |
private Projection |
tileProjection |
private int[] |
tileXMax |
private int[] |
tileXMin |
private int[] |
tileYMax |
private int[] |
tileYMin |
maxZoom, minZoom, osmMercator
baseUrl, id, modTileFeatures, name, tileSize
attributionImage, attributionImageURL, attributionLinkURL, attributionText, termsOfUseText, termsOfUseURL
Constructor and Description |
---|
AbstractWMSTileSource(TileSourceInfo info,
Projection tileProjection)
Constructs a new
AbstractWMSTileSource . |
Modifier and Type | Method and Description |
---|---|
private TileXY |
eastNorthToTileXY(EastNorth enPoint,
int zoom) |
protected java.lang.String |
getBbox(int zoom,
int tilex,
int tiley,
boolean switchLatLon) |
private static java.lang.String |
getBboxstr(double x1,
double x2,
double x3,
double x4) |
private double |
getDegreesPerTile(int zoom) |
java.lang.String |
getServerCRS()
Get coordinate reference system for this tile source.
|
protected EastNorth |
getTileEastNorth(int x,
int y,
int z) |
Projection |
getTileProjection() |
int |
getTileXMax(int zoom)
Get maximum x index of tile for specified zoom level.
|
int |
getTileXMin(int zoom)
Get minimum x index of tile for specified zoom level.
|
int |
getTileYMax(int zoom)
Get maximum y index of tile for specified zoom level.
|
int |
getTileYMin(int zoom)
Get minimum y index of tile for specified zoom level
|
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)
Transforms longitude and latitude to tile indices.
|
TileXY |
latLonToTileXY(ICoordinate point,
int zoom)
Transforms longitude and latitude to tile indices.
|
java.awt.Point |
latLonToXY(double lat,
double lon,
int zoom)
Transforms longitude and latitude to pixel space (as if all tiles at specified zoom level where joined).
|
java.awt.Point |
latLonToXY(ICoordinate point,
int zoom)
Transforms longitude and latitude to pixel space (as if all tiles at specified zoom level where joined).
|
TileXY |
projectedToTileXY(IProjected p,
int zoom)
Convert projected coordinates to tile indices.
|
void |
setTileProjection(Projection tileProjection) |
ICoordinate |
tileXYToLatLon(int x,
int y,
int zoom)
Transforms tile indices to longitude and latitude.
|
ICoordinate |
tileXYToLatLon(Tile tile)
Determines to longitude and latitude of a tile.
|
ICoordinate |
tileXYToLatLon(TileXY xy,
int zoom)
Transforms tile indices to longitude and latitude.
|
IProjected |
tileXYtoProjected(int x,
int y,
int zoom)
Convert tile indices (x/y/zoom) into projected coordinates of the tile origin.
|
ICoordinate |
xyToLatLon(int x,
int y,
int zoom)
Transforms a point in pixel space to longitude/latitude (WGS84).
|
ICoordinate |
xyToLatLon(java.awt.Point point,
int zoom)
Transforms a point in pixel space to longitude/latitude (WGS84).
|
getCoveringTileRange, getDistance, getMaxZoom, getMinZoom, isInside
getBaseUrl, getDefaultTileSize, getExtension, getId, getMetadata, getName, getTileId, getTilePath, getTileSize, getTileUrl, isModTileFeatures, isNoTileAtZoom, toString
getAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution, setAttributionImage, setAttributionImageURL, setAttributionLinkURL, setAttributionText, setTermsOfUseText, setTermsOfUseURL
static final java.text.NumberFormat LATLON_FORMAT
private EastNorth anchorPosition
private int[] tileXMin
private int[] tileYMin
private int[] tileXMax
private int[] tileYMax
private double[] degreesPerTile
private static final float SCALE_DENOMINATOR_ZOOM_LEVEL_1
private Projection tileProjection
public AbstractWMSTileSource(TileSourceInfo info, Projection tileProjection)
AbstractWMSTileSource
.info
- tile source infotileProjection
- the tile projectionprivate void initAnchorPosition(Projection proj)
public void setTileProjection(Projection tileProjection)
public Projection getTileProjection()
public void initProjection()
public void initProjection(Projection proj)
proj
- new projection that shall be used for computationspublic ICoordinate tileXYToLatLon(Tile tile)
TileSource
tileXYToLatLon
in interface TileSource
tileXYToLatLon
in class AbstractTMSTileSource
tile
- Tilepublic ICoordinate tileXYToLatLon(TileXY xy, int zoom)
TileSource
tileXYToLatLon
in interface TileSource
tileXYToLatLon
in class AbstractTMSTileSource
xy
- X/Y tile indiceszoom
- zoom levelpublic ICoordinate tileXYToLatLon(int x, int y, int zoom)
TileSource
tileXYToLatLon
in interface TileSource
tileXYToLatLon
in class TMSTileSource
x
- x tile indexy
- y tile indexzoom
- zoom levelprivate TileXY eastNorthToTileXY(EastNorth enPoint, int zoom)
public TileXY latLonToTileXY(double lat, double lon, int zoom)
TileSource
latLonToTileXY
in interface TileSource
latLonToTileXY
in class TMSTileSource
lat
- latitudelon
- longitudezoom
- zoom levelpublic TileXY latLonToTileXY(ICoordinate point, int zoom)
TileSource
latLonToTileXY
in interface TileSource
latLonToTileXY
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic int getTileXMax(int zoom)
TileSource
getTileXMax
in interface TileSource
getTileXMax
in class AbstractTMSTileSource
zoom
- zoom levelpublic int getTileXMin(int zoom)
TileSource
getTileXMin
in interface TileSource
getTileXMin
in class AbstractTMSTileSource
zoom
- zoom levelpublic int getTileYMax(int zoom)
TileSource
getTileYMax
in interface TileSource
getTileYMax
in class AbstractTMSTileSource
zoom
- zoom levelpublic int getTileYMin(int zoom)
TileSource
getTileYMin
in interface TileSource
getTileYMin
in class AbstractTMSTileSource
zoom
- zoom levelpublic java.awt.Point latLonToXY(double lat, double lon, int zoom)
TileSource
latLonToXY
in interface TileSource
latLonToXY
in class TMSTileSource
lat
- latitudelon
- longitudezoom
- zoom levelpublic java.awt.Point latLonToXY(ICoordinate point, int zoom)
TileSource
latLonToXY
in interface TileSource
latLonToXY
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic ICoordinate xyToLatLon(java.awt.Point point, int zoom)
TileSource
xyToLatLon
in interface TileSource
xyToLatLon
in class AbstractTMSTileSource
point
- pointzoom
- zoom levelpublic ICoordinate xyToLatLon(int x, int y, int zoom)
TileSource
xyToLatLon
in interface TileSource
xyToLatLon
in class TMSTileSource
x
- X coordinatey
- Y coordinatezoom
- zoom levelprotected EastNorth getTileEastNorth(int x, int y, int z)
private double getDegreesPerTile(int zoom)
public IProjected tileXYtoProjected(int x, int y, int zoom)
TileSource
tileXYtoProjected
in interface TileSource
tileXYtoProjected
in class TMSTileSource
x
- x tile indexy
- z tile indexzoom
- zoom levelpublic TileXY projectedToTileXY(IProjected p, int zoom)
TileSource
projectedToTileXY
in interface TileSource
projectedToTileXY
in class TMSTileSource
p
- projected coordinateszoom
- zoom levelpublic java.lang.String getServerCRS()
TileSource
getServerCRS
in interface TileSource
getServerCRS
in class TMSTileSource
protected java.lang.String getBbox(int zoom, int tilex, int tiley, boolean switchLatLon)
private static java.lang.String getBboxstr(double x1, double x2, double x3, double x4)