public enum CoordinateSystem extends java.lang.Enum<CoordinateSystem>
MapView.transformCoordinates(CoordinateSystem, Position, CoordinateSystem)
is the method to use for this purpose.
public static void LatLonToPtvMercator(double latitude, double longitude, out double x, out double y)
{
x = 6371000.0 * longitude * Math.PI / 180.0;
y = 6371000.0 * Math.Log(Math.Tan(Math.PI / 4.0 + latitude * Math.PI / 360.0));
}
PTV Mercator vs. Google Mercatorlog(tan(pi/4 + lat/2))
as 1/2log(1+sin(lat)/(1-sin(lat))
.
The only difference is the underlying earth radius. PTV (and ESRI SRID 53004) use 6371 km
(the mean between major and minor axis of WGS 84), while Google, Microsoft, OSM and
Yahoo use 6378137 meters (the major axis of WGS 84). Looking at the formula above, we see
that the conversion between PTV and Google is quite simple.
public static void PtvToGoogle(double ptvX, double ptvY, out double googleX, out double googleY)
{
googleX = (6378137.0 / 6371000.0) * ptvX;
googleY = (6378137.0 / 6371000.0) * ptvY;
}
Enum Constant and Description |
---|
GEODEZ
Geodecimal (value * 1000000) - WGS84
|
LATNMETER
Latitude (X) and length in meter (Y)
|
MERCATOR
PTV Mercator
|
PIXEL
Pixel of rendered map (depends on the corresponding map view)
|
Modifier and Type | Method and Description |
---|---|
static CoordinateSystem |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CoordinateSystem[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CoordinateSystem MERCATOR
public static final CoordinateSystem GEODEZ
public static final CoordinateSystem PIXEL
public static final CoordinateSystem LATNMETER
public static CoordinateSystem[] values()
for (CoordinateSystem c : CoordinateSystem.values()) System.out.println(c);
public static CoordinateSystem valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null