public final class OsmUrlToBounds extends Object
Modifier and Type | Field and Description |
---|---|
private static char[] |
SHORTLINK_CHARS |
private static 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<Double,Double> |
getTileOfLatLon(double lat,
double lon,
double zoom) |
static String |
getURL(Bounds b)
Return OSM URL for given area.
|
static String |
getURL(double dlat,
double dlon,
int zoom)
Return OSM URL for given lat/lon and zoom.
|
static 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(String url) |
private static double |
parseDouble(Map<String,String> map,
String key) |
private static Bounds |
parseHashURLs(String url)
Openstreetmap.org changed it's URL scheme in August 2013, which breaks the URL parsing.
|
private static Bounds |
parseShortLink(String url)
Parse OSM short link
|
static Bounds |
positionToBounds(double lat,
double lon,
int zoom) |
private static final String SHORTLINK_PREFIX
private static final char[] SHORTLINK_CHARS
private OsmUrlToBounds()
private static Bounds parseHashURLs(String url)
url
- string for parsingnull
otherwiseprivate static double parseDouble(Map<String,String> map, String key)
private static Bounds parseShortLink(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<Double,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 String getURL(Bounds b)
b
- bounds of the areapublic static String getURL(LatLon pos, int zoom)
pos
- center position of areazoom
- zoom depth of display