|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.gui.jmapviewer.OsmMercator
public class OsmMercator
This class implements the Mercator Projection as it is used by Openstreetmap (and google). It provides methods to translate coordinates from 'map space' into latitude and longitude (on the WGS84 ellipsoid) and vice versa. Map space is measured in pixels. The origin of the map space is the top left corner. The map space origin (0,0) has latitude ~85 and longitude -180
Field Summary | |
---|---|
static double |
MAX_LAT
|
static double |
MIN_LAT
|
private static int |
TILE_SIZE
|
Constructor Summary | |
---|---|
OsmMercator()
|
Method Summary | |
---|---|
static int |
falseEasting(int aZoomlevel)
|
static int |
falseNorthing(int aZoomlevel)
|
static int |
getMaxPixels(int aZoomlevel)
Returns the absolut number of pixels in y or x, defined as: 2^Zoomlevel * TILE_WIDTH where TILE_WIDTH is the width of a tile in pixels |
static int |
LatToY(double aLat,
int aZoomlevel)
Transforms latitude to pixelspace |
static int |
LonToX(double aLongitude,
int aZoomlevel)
Transform longitude to pixelspace |
static double |
radius(int aZoomlevel)
|
static double |
XToLon(int aX,
int aZoomlevel)
Transforms pixel coordinate X to longitude |
static double |
YToLat(int aY,
int aZoomlevel)
Transforms pixel coordinate Y to latitude |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int TILE_SIZE
public static final double MAX_LAT
public static final double MIN_LAT
Constructor Detail |
---|
public OsmMercator()
Method Detail |
---|
public static double radius(int aZoomlevel)
public static int getMaxPixels(int aZoomlevel)
aZoomlevel
- public static int falseEasting(int aZoomlevel)
public static int falseNorthing(int aZoomlevel)
public static int LonToX(double aLongitude, int aZoomlevel)
aLongitude
- [-180..180]
public static int LatToY(double aLat, int aZoomlevel)
aLat
- [-90...90]
public static double XToLon(int aX, int aZoomlevel)
aX
- [0..2^Zoomlevel*TILE_WIDTH[
public static double YToLat(int aY, int aZoomlevel)
aY
- [0..2^Zoomlevel*TILE_WIDTH[
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |