public final class OsmUrlToBounds extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
R
radius of the earth
|
private static char[] |
SHORTLINK_CHARS |
private static java.lang.String |
SHORTLINK_PREFIX |
Modifier | Constructor and Description |
---|---|
private |
OsmUrlToBounds() |
Modifier and Type | Method and Description |
---|---|
static LatLon |
getLatLonOfTile(double x,
double y,
double zoom) |
static Pair<java.lang.Double,java.lang.Double> |
getTileOfLatLon(double lat,
double lon,
double zoom) |
static java.lang.String |
getURL(Bounds b)
Return OSM URL for given area.
|
static java.lang.String |
getURL(double dlat,
double dlon,
int zoom)
Return OSM URL for given lat/lon and zoom.
|
static java.lang.String |
getURL(LatLon pos,
int zoom)
Return OSM URL for given position and zoom.
|
static int |
getZoom(Bounds b)
Return OSM Zoom level for a given area
|
static double |
invMercatorY(double north) |
static double |
mercatorY(double lat) |
static Bounds |
parse(java.lang.String url) |
private static double |
parseDouble(java.util.Map<java.lang.String,java.lang.String> map,
java.lang.String key) |
private static Bounds |
parseHashURLs(java.lang.String url)
Openstreetmap.org changed it's URL scheme in August 2013, which breaks the URL parsing.
|
private static Bounds |
parseShortLink(java.lang.String url)
Parse OSM short link
|
static Bounds |
positionToBounds(double lat,
double lon,
int zoom) |
private static final java.lang.String SHORTLINK_PREFIX
private static final char[] SHORTLINK_CHARS
public static final double R
private OsmUrlToBounds()
public static Bounds parse(java.lang.String url) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
private static Bounds parseHashURLs(java.lang.String url) throws java.lang.IllegalArgumentException
url
- string for parsingnull
otherwisejava.lang.IllegalArgumentException
private static double parseDouble(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String key)
private static Bounds parseShortLink(java.lang.String url)
url
- string for parsingpublic static Bounds positionToBounds(double lat, double lon, int zoom)
public static double mercatorY(double lat)
public static double invMercatorY(double north)
public static Pair<java.lang.Double,java.lang.Double> getTileOfLatLon(double lat, double lon, double zoom)
public static LatLon getLatLonOfTile(double x, double y, double zoom)
public static int getZoom(Bounds b)
b
- bounds of the areapublic static java.lang.String getURL(Bounds b)
b
- bounds of the areapublic static java.lang.String getURL(LatLon pos, int zoom)
pos
- center position of areazoom
- zoom depth of displaypublic static java.lang.String getURL(double dlat, double dlon, int zoom)
dlat
- center latitude of areadlon
- center longitude of areazoom
- zoom depth of display