com.mapquest.mapping.models

## Class MercatorProjection

• java.lang.Object
• com.mapquest.mapping.models.MercatorProjection

• ```public class MercatorProjection
extends java.lang.Object```
Project an input longitude/latitude (in degrees) to an easting/northing pair in meters. There are several formulas for this. See PROJ4, PROJ4JS, or other sources. Map Projections, a Working Manual (USGS Professional Paper 1395) gives the following: x = R (lon - lon0) y = R ln tan ((pi / 4) + (lat / 2)) ...or y = (R/2) [ln ((1 + sin(lat)) / (1 - sin(lat))] And if lon/lat are in degrees: x = PI R (lon - lon0) / 180 y = R ln tan (45 + (lat / 2)) http://stackoverflow.com/questions /14329691/covert-latitude-longitude-point-to-a-pixels-x-y-on-mercator-projection http://docs.openlayers.org/library/spherical_mercator.html
• ### Field Summary

Fields
Modifier and Type Field and Description
`static double` `DEGREES_PER_RADIAN`
`static double` `DEGREES_TO_METERS_ON_EARTH`
`static double` `EARTH_RADIUS_METERS`
`static double` `INCHES_PER_METER`
`static double` `INVERSE_EARTH_RADIUS_METERS`
`static double` `METERS_TO_DEGREES_ON_EARTH`
`static double` `PI_OVER2`
`static double` `RADIANS_PER_DEGREE`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static LatLng` `inverseTransform(android.graphics.PointF p)`
`static android.graphics.PointF` `transform(LatLng ll)`
Get the point on the Spherical Mercator projection plane given a LatLng
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### INCHES_PER_METER

`public static final double INCHES_PER_METER`
Constant Field Values

`public static final double EARTH_RADIUS_METERS`
Constant Field Values

`public static final double INVERSE_EARTH_RADIUS_METERS`
Constant Field Values
• #### PI_OVER2

`public static final double PI_OVER2`
Constant Field Values

`public static final double RADIANS_PER_DEGREE`
Constant Field Values

`public static final double DEGREES_PER_RADIAN`
Constant Field Values
• #### DEGREES_TO_METERS_ON_EARTH

`public static final double DEGREES_TO_METERS_ON_EARTH`
Constant Field Values
• #### METERS_TO_DEGREES_ON_EARTH

`public static final double METERS_TO_DEGREES_ON_EARTH`
Constant Field Values
• ### Method Detail

• #### transform

`public static android.graphics.PointF transform(LatLng ll)`
Get the point on the Spherical Mercator projection plane given a LatLng
Parameters:
`ll` - Latitude, longitude (degrees)
Returns:
The projected point on the Mercator plane (meters)
• #### inverseTransform

`public static LatLng inverseTransform(android.graphics.PointF p)`