public class TransverseMercator extends AbstractProj
The elliptical equations used here are series approximations, and their accuracy decreases as points move farther from the central meridian of the projection. The forward equations here are accurate to a less than a mm ±10 degrees from the central meridian, a few mm ±15 degrees from the central meridian and a few cm ±20 degrees from the central meridian. The spherical equations are not approximations and should always give the correct values.
There are a number of versions of the transverse mercator projection including the Universal (UTM) and Modified (MTM) Transverses Mercator projections. In these cases the earth is divided into zones. For the UTM the zones are 6 degrees wide, numbered from 1 to 60 proceeding east from 180 degrees longitude, and between lats 84 degrees North and 80 degrees South. The central meridian is taken as the center of the zone and the latitude of origin is the equator. A scale factor of 0.9996 and false easting of 500000m is used for all zones and a false northing of 10000000m is used for zones in the southern hemisphere.
NOTE: formulas used below are not those of Snyder, but rather those
from the proj4
package of the USGS survey, which
have been reproduced verbatim. USGS work is acknowledged here.
This class has been derived from the implementation of the Geotools project; git 8cbf52d, org.geotools.referencing.operation.projection.TransverseMercator at the time of migration.
The non-standard parameter gamma
has been added as a method
to rotate the projected coordinates by a certain angle (clockwise, see
ObliqueMercator
).
References:
PJ_tmerc.c
, pj_mlfn.c
, pj_fwd.c
and pj_inv.c
.Modifier and Type | Class and Description |
---|---|
static class |
TransverseMercator.Hemisphere
Earth emispheres
|
Modifier and Type | Field and Description |
---|---|
private double |
cosrot
Sine and Cosine values for the coordinate system rotation angle
|
private double |
eb2
A derived quantity of excentricity, computed by
e'² = (a²-b²)/b² = es/(1-es)
where a is the semi-major axis length and b is the semi-minor axis length. |
private static double |
EPSILON
Maximum difference allowed when comparing real numbers.
|
private static double |
FC1
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
private static double |
FC2
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
private static double |
FC3
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
private static double |
FC4
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
private static double |
FC5
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
private static double |
FC6
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
private static double |
FC7
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
private static double |
FC8
Constants used for the forward and inverse transform for the elliptical
case of the Transverse Mercator.
|
protected double |
latitudeOfOrigin
Latitude of origin in radians.
|
private double |
ml0
Meridian distance at the
latitudeOfOrigin . |
protected double |
rectifiedGridAngle
The rectified bearing of the central line, in radians.
|
private double |
sinrot
Sine and Cosine values for the coordinate system rotation angle
|
Constructor and Description |
---|
TransverseMercator() |
Modifier and Type | Method and Description |
---|---|
Bounds |
getAlgorithmBounds()
Return the bounds where this projection is applicable.
|
java.lang.String |
getName()
Replies a human readable name of this projection.
|
java.lang.String |
getProj4Id()
Replies the Proj.4 identifier.
|
void |
initialize(ProjParameters params)
Initialize the projection using the provided parameters.
|
double[] |
invproject(double x,
double y)
Convert east/north to lat/lon.
|
static Pair<java.lang.Integer,TransverseMercator.Hemisphere> |
locateUtmZone(LatLon ll)
Determines the UTM zone of a given lat/lon.
|
double[] |
project(double y,
double x)
Convert lat/lon to east/north.
|
aasin, cphi2, invMlfn, isGeographic, mlfn, msfn, tsfn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
lonIsLinearToEast
private static final double FC1
private static final double FC2
private static final double FC3
private static final double FC4
private static final double FC5
private static final double FC6
private static final double FC7
private static final double FC8
private static final double EPSILON
private double eb2
e'² = (a²-b²)/b² = es/(1-es)
where a is the semi-major axis length and b is the semi-minor axis length.protected double latitudeOfOrigin
private double ml0
latitudeOfOrigin
.
Used for calculations for the ellipsoid.protected double rectifiedGridAngle
private double sinrot
private double cosrot
public TransverseMercator()
public java.lang.String getName()
Proj
public java.lang.String getProj4Id()
Proj
null
.public void initialize(ProjParameters params) throws ProjectionConfigurationException
Proj
initialize
in interface Proj
initialize
in class AbstractProj
params
- The projection parametersProjectionConfigurationException
- in case parameters are not suitablepublic double[] project(double y, double x)
Proj
y
- the latitude in radiansx
- the longitude in radianspublic double[] invproject(double x, double y)
Proj
x
- east value in meters, divided by the semi major axis of the ellipsoidy
- north value in meters, divided by the semi major axis of the ellipsoidpublic Bounds getAlgorithmBounds()
Proj
public static Pair<java.lang.Integer,TransverseMercator.Hemisphere> locateUtmZone(LatLon ll)
ll
- lat/lon to locate in the UTM grid.ll