public final class MercatorProjection
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
EARTH_CIRCUMFERENCE
The circumference of the earth at the equator in meters.
|
static double |
LATITUDE_MAX
Maximum possible latitude coordinate of the map.
|
static double |
LATITUDE_MIN
Minimum possible latitude coordinate of the map.
|
static double |
LONGITUDE_MAX
Maximum possible longitude coordinate of the map.
|
static double |
LONGITUDE_MIN
Minimum possible longitude coordinate of the map.
|
| Modifier and Type | Method and Description |
|---|---|
static GeoPoint |
fromPixels(double pixelX,
double pixelY,
long mapSize)
Get GeoPoint from Pixels.
|
static GeoPoint |
fromPixelsWithScale(double pixelX,
double pixelY,
double scale)
Get GeoPoint from Pixels.
|
static long |
getMapSize(byte zoomLevel) |
static long |
getMapSizeWithScale(double scale) |
static Point |
getPixel(GeoPoint geoPoint,
long mapSize) |
static Point |
getPixelAbsolute(GeoPoint geoPoint,
long mapSize)
Calculates the absolute pixel position for a map size and tile size
|
static Point |
getPixelRelative(GeoPoint geoPoint,
long mapSize,
double x,
double y)
Calculates the absolute pixel position for a map size and tile size relative to origin
|
static Point |
getPixelRelative(GeoPoint geoPoint,
long mapSize,
Point origin)
Calculates the absolute pixel position for a map size and tile size relative to origin
|
static Point |
getPixelRelativeToTile(GeoPoint geoPoint,
Tile tile)
Calculates the absolute pixel position for a tile and tile size relative to origin
|
static Point |
getPixelWithScale(GeoPoint geoPoint,
double scale) |
static double |
groundResolution(double latitude,
long mapSize)
Calculates the distance on the ground that is represented by a single pixel on the map.
|
static double |
groundResolution(MapPosition pos) |
static double |
groundResolutionWithScale(double latitude,
double scale)
Calculates the distance on the ground that is represented by a single
pixel on the map.
|
static double |
latitudeToPixelY(double latitude,
byte zoomLevel)
Converts a latitude coordinate (in degrees) to a pixel Y coordinate at a certain zoom level.
|
static double |
latitudeToPixelY(double latitude,
long mapSize)
Converts a latitude coordinate (in degrees) to a pixel Y coordinate at a certain map size.
|
static double |
latitudeToPixelYWithScale(double latitude,
double scale)
Converts a latitude coordinate (in degrees) to a pixel Y coordinate at a certain scale.
|
static int |
latitudeToTileY(double latitude,
byte zoomLevel)
Converts a latitude coordinate (in degrees) to a tile Y number at a certain zoom level.
|
static int |
latitudeToTileYWithScale(double latitude,
double scale)
Converts a latitude coordinate (in degrees) to a tile Y number at a certain scale.
|
static double |
latitudeToY(double latitude)
Projects a latitude coordinate (in degrees) to the range [0.0,1.0]
|
static double |
limitLatitude(double latitude) |
static double |
limitLongitude(double longitude) |
static double |
longitudeToPixelX(double longitude,
byte zoomLevel)
Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain zoom level.
|
static double |
longitudeToPixelX(double longitude,
long mapSize)
Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain map size.
|
static double |
longitudeToPixelXWithScale(double longitude,
double scale)
Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain scale factor.
|
static int |
longitudeToTileX(double longitude,
byte zoomLevel)
Converts a longitude coordinate (in degrees) to the tile X number at a certain zoom level.
|
static int |
longitudeToTileXWithScale(double longitude,
double scale)
Converts a longitude coordinate (in degrees) to the tile X number at a certain scale factor.
|
static double |
longitudeToX(double longitude)
Projects a longitude coordinate (in degrees) to the range [0.0,1.0]
|
static double |
metersToPixels(float meters,
double latitude,
long mapSize)
Converts meters to pixels at latitude for zoom-level.
|
static double |
metersToPixelsWithScale(float meters,
double latitude,
double scale)
Converts meters to pixels at latitude for zoom-level.
|
static double |
pixelXToLongitude(double pixelX,
long mapSize)
Converts a pixel X coordinate at a certain map size to a longitude coordinate.
|
static double |
pixelXToLongitudeWithScale(double pixelX,
double scale)
Converts a pixel X coordinate at a certain scale to a longitude coordinate.
|
static int |
pixelXToTileX(double pixelX,
byte zoomLevel)
Converts a pixel X coordinate to the tile X number.
|
static int |
pixelXToTileXWithScale(double pixelX,
double scale)
Converts a pixel X coordinate to the tile X number.
|
static double |
pixelYToLatitude(double pixelY,
long mapSize)
Converts a pixel Y coordinate at a certain map size to a latitude coordinate.
|
static double |
pixelYToLatitudeWithScale(double pixelY,
double scale)
Converts a pixel Y coordinate at a certain scale to a latitude coordinate.
|
static int |
pixelYToTileY(double pixelY,
byte zoomLevel)
Converts a pixel Y coordinate to the tile Y number.
|
static int |
pixelYToTileYWithScale(double pixelY,
double scale)
Converts a pixel Y coordinate to the tile Y number.
|
static void |
project(double latitude,
double longitude,
double[] out,
int pos) |
static void |
project(GeoPoint p,
double[] out,
int pos) |
static Point |
project(GeoPoint p,
Point reuse) |
static double |
scaleToZoomLevel(double scale)
Converts a scale factor to a zoomLevel.
|
static long |
tileToPixel(long tileNumber) |
static double |
tileXToLongitude(long tileX,
byte zoomLevel)
Converts a tile X number at a certain zoom level to a longitude coordinate.
|
static double |
tileXToLongitudeWithScale(long tileX,
double scale)
Converts a tile X number at a certain scale to a longitude coordinate.
|
static double |
tileYToLatitude(long tileY,
byte zoomLevel)
Converts a tile Y number at a certain zoom level to a latitude coordinate.
|
static double |
tileYToLatitudeWithScale(long tileY,
double scale)
Converts a tile Y number at a certain scale to a latitude coordinate.
|
static long |
tileYToTMS(long tileY,
byte zoomLevel)
Converts a tile Y number at a certain zoom level to TMS notation.
|
static double |
toLatitude(double y)
Converts y map position to latitude in degrees.
|
static double |
toLongitude(double x)
Converts x map position to longitude in degrees.
|
static double |
wrapLongitude(double longitude) |
static double |
zoomLevelToScale(byte zoomLevel)
Converts a zoom level to a scale factor.
|
public static final double EARTH_CIRCUMFERENCE
public static final double LATITUDE_MAX
public static final double LATITUDE_MIN
public static final double LONGITUDE_MAX
public static final double LONGITUDE_MIN
public static GeoPoint fromPixelsWithScale(double pixelX, double pixelY, double scale)
public static GeoPoint fromPixels(double pixelX, double pixelY, long mapSize)
public static long getMapSizeWithScale(double scale)
scale - the scale factor for which the size of the world map should be returned.java.lang.IllegalArgumentException - if the given scale factor is < 1public static long getMapSize(byte zoomLevel)
zoomLevel - the zoom level for which the size of the world map should be returned.java.lang.IllegalArgumentException - if the given zoom level is negative.public static Point getPixelAbsolute(GeoPoint geoPoint, long mapSize)
geoPoint - the geographic position.mapSize - precomputed size of map.public static Point getPixelRelative(GeoPoint geoPoint, long mapSize, double x, double y)
geoPoint - the geographic position.mapSize - precomputed size of map.public static Point getPixelRelative(GeoPoint geoPoint, long mapSize, Point origin)
geoPoint - the geographic position.mapSize - precomputed size of map.public static Point getPixelRelativeToTile(GeoPoint geoPoint, Tile tile)
geoPoint - the geographic position.tile - tilepublic static double groundResolutionWithScale(double latitude,
double scale)
latitude - the latitude coordinate at which the resolution should be
calculated.scale - the map scale at which the resolution should be calculated.public static double groundResolution(MapPosition pos)
public static double groundResolution(double latitude,
long mapSize)
latitude - the latitude coordinate at which the resolution should be calculated.mapSize - precomputed size of map.public static double latitudeToPixelYWithScale(double latitude,
double scale)
latitude - the latitude coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.public static double latitudeToPixelY(double latitude,
byte zoomLevel)
latitude - the latitude coordinate that should be converted.zoomLevel - the zoom level at which the coordinate should be converted.public static double latitudeToPixelY(double latitude,
long mapSize)
latitude - the latitude coordinate that should be converted.mapSize - precomputed size of map.public static int latitudeToTileYWithScale(double latitude,
double scale)
latitude - the latitude coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.public static int latitudeToTileY(double latitude,
byte zoomLevel)
latitude - the latitude coordinate that should be converted.zoomLevel - the zoom level at which the coordinate should be converted.public static double latitudeToY(double latitude)
latitude - the latitude coordinate that should be converted.public static double limitLatitude(double latitude)
latitude - the latitude value which should be checked.public static double limitLongitude(double longitude)
longitude - the longitude value which should be checked.public static double longitudeToPixelXWithScale(double longitude,
double scale)
longitude - the longitude coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.public static double longitudeToPixelX(double longitude,
byte zoomLevel)
longitude - the longitude coordinate that should be converted.zoomLevel - the zoom level at which the coordinate should be converted.public static double longitudeToPixelX(double longitude,
long mapSize)
longitude - the longitude coordinate that should be converted.mapSize - precomputed size of map.public static int longitudeToTileXWithScale(double longitude,
double scale)
longitude - the longitude coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.public static int longitudeToTileX(double longitude,
byte zoomLevel)
longitude - the longitude coordinate that should be converted.zoomLevel - the zoom level at which the coordinate should be converted.public static double longitudeToX(double longitude)
longitude - the longitude coordinate that should be converted.public static double metersToPixelsWithScale(float meters,
double latitude,
double scale)
meters - the meters to convertlatitude - the latitude for the conversion.scale - the scale factor for the conversion.public static double metersToPixels(float meters,
double latitude,
long mapSize)
meters - the meters to convertlatitude - the latitude for the conversion.mapSize - precomputed size of map.public static double pixelXToLongitudeWithScale(double pixelX,
double scale)
pixelX - the pixel X coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.java.lang.IllegalArgumentException - if the given pixelX coordinate is invalid.public static double pixelXToLongitude(double pixelX,
long mapSize)
pixelX - the pixel X coordinate that should be converted.mapSize - precomputed size of map.java.lang.IllegalArgumentException - if the given pixelX coordinate is invalid.public static int pixelXToTileXWithScale(double pixelX,
double scale)
pixelX - the pixel X coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.public static int pixelXToTileX(double pixelX,
byte zoomLevel)
pixelX - the pixel X coordinate that should be converted.zoomLevel - the zoom level at which the coordinate should be converted.public static double pixelYToLatitudeWithScale(double pixelY,
double scale)
pixelY - the pixel Y coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.java.lang.IllegalArgumentException - if the given pixelY coordinate is invalid.public static double pixelYToLatitude(double pixelY,
long mapSize)
pixelY - the pixel Y coordinate that should be converted.mapSize - precomputed size of map.java.lang.IllegalArgumentException - if the given pixelY coordinate is invalid.public static int pixelYToTileYWithScale(double pixelY,
double scale)
pixelY - the pixel Y coordinate that should be converted.scale - the scale factor at which the coordinate should be converted.public static int pixelYToTileY(double pixelY,
byte zoomLevel)
pixelY - the pixel Y coordinate that should be converted.zoomLevel - the zoom level at which the coordinate should be converted.public static void project(GeoPoint p, double[] out, int pos)
public static void project(double latitude,
double longitude,
double[] out,
int pos)
public static double scaleToZoomLevel(double scale)
scale - the scale factor to convert to a zoom level.public static long tileToPixel(long tileNumber)
tileNumber - the tile number that should be converted.public static double tileXToLongitudeWithScale(long tileX,
double scale)
tileX - the tile X number that should be converted.scale - the scale factor at which the number should be converted.public static double tileXToLongitude(long tileX,
byte zoomLevel)
tileX - the tile X number that should be converted.zoomLevel - the zoom level at which the number should be converted.public static double tileYToLatitudeWithScale(long tileY,
double scale)
tileY - the tile Y number that should be converted.scale - the scale factor at which the number should be converted.public static double tileYToLatitude(long tileY,
byte zoomLevel)
tileY - the tile Y number that should be converted.zoomLevel - the zoom level at which the number should be converted.public static long tileYToTMS(long tileY,
byte zoomLevel)
tileY - the tile Y number that should be converted.zoomLevel - the zoom level at which the number should be converted.public static double toLatitude(double y)
y - the map position y.public static double toLongitude(double x)
x - the map position x.public static double wrapLongitude(double longitude)
public static double zoomLevelToScale(byte zoomLevel)
zoomLevel - the zoom level to convert.