public class MapTileUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
EARTH_RADIUS |
static int |
LEVEL_MAX |
static int |
LEVEL_MIN |
static int |
LEVEL_OFFSET |
static double |
MAX_LATITUDE |
static double |
MAX_LONGITUDE |
static double |
MIN_LATITUDE |
static double |
MIN_LONGITUDE |
static boolean |
USE_CLIPPING |
| Constructor and Description |
|---|
MapTileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.awt.geom.Point2D |
degreesToXY(double latitude,
double longitude,
int levelOfDetail)
Converts a point from latitude/longitude WGS-84 coordinates (in degrees) into pixel XY coordinates at a specified level of detail.
|
static double[] |
getOffsetFrom(double latitudeRef,
double longitudeRef,
double latitude,
double longitude)
This will return an north and east offsets using Mercator projection at levelOfDetail=22.
|
static double[] |
getOffsetFrom(double latitudeRef,
double longitudeRef,
double latitude,
double longitude,
int levelOfDetail)
This will return an north and east offsets using Mercator projection in an specific levelOfDetail.
|
static double[] |
getOffsetInPixels(LocationType start,
LocationType end)
Gets offset in pixels with default level for creating shape only !!!!
|
static double[] |
getOffsetInPixels(LocationType start,
LocationType end,
int level)
Gets offset in pixels with given level
|
static double |
groundResolution(double latitude,
int levelOfDetail)
Determines the ground resolution (in meters per pixel) at a specified latitude and level of detail.
|
static void |
main(java.lang.String[] args) |
static double |
mapScale(double latitude,
int levelOfDetail,
int screenDpi)
Determines the map scale at a specified latitude, level of detail, and screen resolution.
|
static int |
mapSize(int levelOfDetail)
Determines the map width and height (in pixels) at a specified level of detail.
|
static int[] |
pixelXYToTileXY(int pixelX,
int pixelY)
Converts pixel XY coordinates into tile XY coordinates of the tile containing the specified pixel.
|
static int[] |
quadKeyToTileXY(java.lang.String quadKey)
Converts a QuadKey into tile XY coordinates.
|
static int[] |
tileXYToPixelXY(int tileX,
int tileY)
Converts tile XY coordinates into pixel XY coordinates of the upper-left pixel of the specified tile.
|
static java.lang.String |
tileXYToQuadKey(int tileX,
int tileY,
int levelOfDetail)
Converts tile XY coordinates into a QuadKey at a specified level of detail.
|
static double[] |
xyToDegrees(double pixelX,
double pixelY,
int levelOfDetail)
Converts a pixel from pixel XY coordinates at a specified level of detail into latitude/longitude WGS-84 coordinates (in degrees).
|
public static final int LEVEL_OFFSET
public static final int LEVEL_MIN
public static final int LEVEL_MAX
public static final double EARTH_RADIUS
public static final double MIN_LATITUDE
public static final double MAX_LATITUDE
public static final double MIN_LONGITUDE
public static final double MAX_LONGITUDE
public static final boolean USE_CLIPPING
public static int mapSize(int levelOfDetail)
public static double groundResolution(double latitude,
int levelOfDetail)
latitude - Latitude (in degrees) at which to measure the ground resolution.levelOfDetail - Level of detail, from 1 (lowest detail) to 23 (highest detail).public static double mapScale(double latitude,
int levelOfDetail,
int screenDpi)
latitude - Latitude (in degrees) at which to measure the map scale.levelOfDetail - Level of detail, from 1 (lowest detail) to 23 (highest detail).screenDpi - Resolution of the screen, in dots per inch.public static java.awt.geom.Point2D degreesToXY(double latitude,
double longitude,
int levelOfDetail)
latitude - Latitude of the point, in degrees.longitude - Longitude of the point, in degrees.levelOfDetail - Level of detail, from 1 (lowest detail) to 23 (highest detail).public static double[] xyToDegrees(double pixelX,
double pixelY,
int levelOfDetail)
pixelX - X coordinate of the point, in pixels.pixelY - Y coordinates of the point, in pixels.levelOfDetail - Level of detail, from 1 (lowest detail) to 23 (highest detail).public static int[] pixelXYToTileXY(int pixelX,
int pixelY)
pixelX - Pixel X coordinate.pixelY - Pixel Y coordinate.public static int[] tileXYToPixelXY(int tileX,
int tileY)
tileX - Tile X coordinate.tileY - Tile Y coordinate.public static java.lang.String tileXYToQuadKey(int tileX,
int tileY,
int levelOfDetail)
tileX - Tile X coordinate.tileY - Tile Y coordinate.levelOfDetail - Level of detail, from 1 (lowest detail) to 23 (highest detail).public static int[] quadKeyToTileXY(java.lang.String quadKey)
throws java.lang.Exception
quadKey - QuadKey of the tile.java.lang.Exceptionpublic static double[] getOffsetFrom(double latitudeRef,
double longitudeRef,
double latitude,
double longitude)
getOffsetFrom(double, double, double, double, int).latitudeRef - longitudeRef - latitude - longitude - public static double[] getOffsetFrom(double latitudeRef,
double longitudeRef,
double latitude,
double longitude,
int levelOfDetail)
latitudeRef - longitudeRef - latitude - longitude - levelOfDetail - public static double[] getOffsetInPixels(LocationType start, LocationType end, int level)
start - end - level - public static double[] getOffsetInPixels(LocationType start, LocationType end)
start - end - public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.ExceptionCopyright © 2004-2016 FEUP-LSTS and Neptus developers. All Rights Reserved.