public abstract class ICRS extends Object
Modifier and Type | Method and Description |
---|---|
String |
getCode()
Retrieves the standard code name of the CRS passed into WMS services
(e.g.
|
static ICRS |
getEPSG3395()
Rarely used by some commercial tile providers.
|
static ICRS |
getEPSG3857()
The most common CRS for online maps, used by almost all free and
commercial tile providers.
|
static ICRS |
getEPSG4326()
A common CRS among GIS enthusiasts.
|
IProjection |
getProjection()
Retrieves the projection that this CRS uses
|
static ICRS |
getSimple()
A simple CRS that maps longitude and latitude into
x and
y directly. |
Point |
getSize(int zoom)
Returns the size of the world in pixels for a particular zoom.
|
Transformation |
getTransformation()
Retrieves the transformation that this CRS uses to turn projected
coordinates into screen coordinates for a particular tile service.
|
Point |
latLngToPoint(LatLng latlng,
int zoom)
Projects geographical coordinates on a given zoom into pixel coordinates.
|
LatLng |
pointToLatLng(Point point,
int zoom)
The inverse of
latLngToPoint . |
Point |
project(LatLng latlng)
Projects geographical coordinates into coordinates in units accepted for
this CRS (e.g. meters for
EPSG:3857 , for passing it to WMS
services). |
double |
scale(int zoom)
Returns the scale used when transforming projected coordinates into pixel
coordinates for a particular zoom.
|
public static ICRS getEPSG3857()
public static ICRS getSimple()
x
and
y
directly. May be used for maps of flat surfaces (e.g. game
maps). Note that the y
axis should still be inverted (going
from bottom to top).public static ICRS getEPSG3395()
public static ICRS getEPSG4326()
public Point latLngToPoint(LatLng latlng, int zoom)
latlng
- geographical coordinateszoom
- zoom levelpublic LatLng pointToLatLng(Point point, int zoom)
latLngToPoint
. Projects pixel coordinates on
a given zoom into geographical coordinates.point
- pixel coordinateszoom
- zoom levelpublic Point project(LatLng latlng)
EPSG:3857
, for passing it to WMS
services).latlng
- geographical coordinatespublic double scale(int zoom)
256 * 2^zoom
for Mercator-based CRS.zoom
- zoom levelpublic Point getSize(int zoom)
zoom
- zoom levelpublic IProjection getProjection()
public Transformation getTransformation()
public String getCode()
'EPSG:3857'
)Copyright © 2017. All rights reserved.