org.openstreetmap.josm.data.projection.proj
Class TransverseMercator

java.lang.Object
  extended by org.openstreetmap.josm.data.projection.proj.TransverseMercator
All Implemented Interfaces:
Proj

public class TransverseMercator
extends java.lang.Object
implements Proj

Transverse Mercator projection.


Field Summary
protected  double a
           
protected  double b
           
 
Constructor Summary
TransverseMercator()
           
 
Method Summary
private  double ArcLengthOfMeridian(double phi)
          ArcLengthOfMeridian Computes the ellipsoidal distance from the equator to a point at a given latitude.
private  double footpointLatitude(double y)
          FootpointLatitude Computes the footpoint latitude for use in converting transverse Mercator coordinates to ellipsoidal coordinates.
 java.lang.String getName()
          A Human readable name of this projection.
 java.lang.String getProj4Id()
          The Proj.4 identifier.
 void initialize(ProjParameters params)
          Initialize the projection using the provided parameters.
 double[] invproject(double x, double y)
          Converts x and y coordinates in the Transverse Mercator projection to a latitude/longitude pair.
 double[] project(double phi, double lambda)
          Converts a latitude/longitude pair to x and y coordinates in the Transverse Mercator projection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

protected double a

b

protected double b
Constructor Detail

TransverseMercator

public TransverseMercator()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Proj
A Human readable name of this projection.

Specified by:
getName in interface Proj

getProj4Id

public java.lang.String getProj4Id()
Description copied from interface: Proj
The Proj.4 identifier. (as reported by cs2cs -lp) If no id exists, return null.

Specified by:
getProj4Id in interface Proj

initialize

public void initialize(ProjParameters params)
                throws ProjectionConfigurationException
Description copied from interface: Proj
Initialize the projection using the provided parameters.

Specified by:
initialize in interface Proj
Throws:
ProjectionConfigurationException - in case parameters are not suitable

project

public double[] project(double phi,
                        double lambda)
Converts a latitude/longitude pair to x and y coordinates in the Transverse Mercator projection. Note that Transverse Mercator is not the same as UTM; a scale factor is required to convert between them. Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994.

Specified by:
project in interface Proj
Parameters:
phi - Latitude of the point, in radians
lambda - Longitude of the point, in radians
Returns:
A 2-element array containing the x and y coordinates of the computed point

invproject

public double[] invproject(double x,
                           double y)
Converts x and y coordinates in the Transverse Mercator projection to a latitude/longitude pair. Note that Transverse Mercator is not the same as UTM; a scale factor is required to convert between them. Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994. Remarks: The local variables Nf, nuf2, tf, and tf2 serve the same purpose as N, nu2, t, and t2 in MapLatLonToXY, but they are computed with respect to the footpoint latitude phif. x1frac, x2frac, x2poly, x3poly, etc. are to enhance readability and to optimize computations.

Specified by:
invproject in interface Proj
Parameters:
x - The easting of the point, in meters, divided by the semi major axis of the ellipsoid
y - The northing of the point, in meters, divided by the semi major axis of the ellipsoid
Returns:
A 2-element containing the latitude and longitude in radians

ArcLengthOfMeridian

private double ArcLengthOfMeridian(double phi)
ArcLengthOfMeridian Computes the ellipsoidal distance from the equator to a point at a given latitude. Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994.

Parameters:
phi - Latitude of the point, in radians
Returns:
The ellipsoidal distance of the point from the equator (in meters, divided by the semi major axis of the ellipsoid)

footpointLatitude

private double footpointLatitude(double y)
FootpointLatitude Computes the footpoint latitude for use in converting transverse Mercator coordinates to ellipsoidal coordinates. Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J., GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994.

Parameters:
y - northing coordinate, in meters, divided by the semi major axis of the ellipsoid
Returns:
The footpoint latitude, in radians


JOSM