gistoolkit.projection
Class TransversMercatorProjection

java.lang.Object
  extended bygistoolkit.projection.TransversMercatorProjection
All Implemented Interfaces:
EllipsoidProjection, Projection
Direct Known Subclasses:
BritishNationalGridProjection, UniversalTransverseMercatorProjection

public class TransversMercatorProjection
extends java.lang.Object
implements Projection, EllipsoidProjection

Performs a Transvers Mercator projection from Latitude Longitude to UTM or so.


Constructor Summary
TransversMercatorProjection()
          Creates new TransversMercatorProjection
 
Method Summary
 void altTransformBackward(Point inPoint)
          perform the revers transform
 void altTransformForward(Point inPoint)
          perform the conversion
 java.lang.Object clone()
          clone this object
protected  double forwardM(double phi, double sphi, double cphi, double[] inCoefficients)
          Utility functions for calculating M in forward direction.
 double getCentralScale()
          Retrieve the central scale factor, default is 0.9996
protected  double[] getCoefficients(double es)
          Calculate the series expansion.
 double getEasting()
          Retrieve the easting of true oragin for this projection
 Ellipsoid getEllipsoid()
          Retrieve the ellipsoid used to model the lat long coordinates of the earth
 double getLatOragin()
          Retrieve the latitude location of the true oragin of the map.
 double getLonOragin()
          Retrieve the longatude location of the true oragin of the map.
 Node getNode()
          Return the configuration information for this projection
 double getNorthing()
          Retrieve the northing of true oragin for this projection
 java.lang.String getProjectionName()
          return the name of the projection
 java.lang.String getUnitOfMeasure()
          Returns the units of measure for the projection.
static void main(java.lang.String[] inArgs)
           
 void projectBackward(Point inPoint)
          Transform from from map coordinates to lat long
 void projectForward(Point inPoint)
          Transform from from Lat Long to map coordinates
protected  double reverseM(double arg, double es, double[] inCoefficients)
          Utility function for calculating M in the reverse direction.
 void setCentralScale(double inCentralScale)
          Set the central scale factor, default is 0.9996
 void setEasting(double inEasting)
          Set the easting of true oragin for this projection
 void setEllipsoid(Ellipsoid inEllipsoid)
          Set the ellipsoid used to model the lat long coordinates of the earth
 void setEnvelope(Envelope inEnvelope)
          set the envelope of the map.
 void setLatOragin(double inLatOragin)
          Set the latitude location of the true oragin of the map.
 void setLonOragin(double inLonOragin)
          Set the longatude location of the true oragin of the map.
 void setNode(Node inNode)
          Setup this projection using the configuration information in the node
 void setNorthing(double inNorthing)
          Set the northing of true oragin for this projection
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransversMercatorProjection

public TransversMercatorProjection()
Creates new TransversMercatorProjection

Method Detail

getNorthing

public double getNorthing()
Retrieve the northing of true oragin for this projection


setNorthing

public void setNorthing(double inNorthing)
Set the northing of true oragin for this projection


getEasting

public double getEasting()
Retrieve the easting of true oragin for this projection


setEasting

public void setEasting(double inEasting)
Set the easting of true oragin for this projection


getCentralScale

public double getCentralScale()
Retrieve the central scale factor, default is 0.9996


setCentralScale

public void setCentralScale(double inCentralScale)
Set the central scale factor, default is 0.9996


getLatOragin

public double getLatOragin()
Retrieve the latitude location of the true oragin of the map.


setLatOragin

public void setLatOragin(double inLatOragin)
Set the latitude location of the true oragin of the map.


getLonOragin

public double getLonOragin()
Retrieve the longatude location of the true oragin of the map.


setLonOragin

public void setLonOragin(double inLonOragin)
Set the longatude location of the true oragin of the map.


getEllipsoid

public Ellipsoid getEllipsoid()
Retrieve the ellipsoid used to model the lat long coordinates of the earth

Specified by:
getEllipsoid in interface EllipsoidProjection

setEllipsoid

public void setEllipsoid(Ellipsoid inEllipsoid)
Set the ellipsoid used to model the lat long coordinates of the earth


getUnitOfMeasure

public java.lang.String getUnitOfMeasure()
Returns the units of measure for the projection.

Specified by:
getUnitOfMeasure in interface Projection

projectForward

public void projectForward(Point inPoint)
Transform from from Lat Long to map coordinates

Specified by:
projectForward in interface Projection

projectBackward

public void projectBackward(Point inPoint)
Transform from from map coordinates to lat long

Specified by:
projectBackward in interface Projection

getCoefficients

protected double[] getCoefficients(double es)
Calculate the series expansion. eSquared = (a^2-b^2)/(a^2) where a and b are the major and minor axes of the ellipsoid in question.


forwardM

protected double forwardM(double phi,
                          double sphi,
                          double cphi,
                          double[] inCoefficients)
Utility functions for calculating M in forward direction. meridinal distance for ellipsoid and inverse 8th degree - accurate to < 1e-5 meters when used in conjuction with typical major axis values.


reverseM

protected double reverseM(double arg,
                          double es,
                          double[] inCoefficients)
Utility function for calculating M in the reverse direction. This is an itterative approach that rairly goes beyond 2 itterations, However it is designed to break at MAX_ITERATIONS and return the best guess at that point. Inverse determines phi to EPS (1e-11) radians, about 1e-6 seconds.


main

public static void main(java.lang.String[] inArgs)

altTransformForward

public void altTransformForward(Point inPoint)
perform the conversion


altTransformBackward

public void altTransformBackward(Point inPoint)
perform the revers transform


getProjectionName

public java.lang.String getProjectionName()
return the name of the projection

Specified by:
getProjectionName in interface Projection

getNode

public Node getNode()
Return the configuration information for this projection

Specified by:
getNode in interface Projection

setNode

public void setNode(Node inNode)
             throws java.lang.Exception
Setup this projection using the configuration information in the node

Specified by:
setNode in interface Projection
Throws:
java.lang.Exception

clone

public java.lang.Object clone()
clone this object

Specified by:
clone in interface Projection

setEnvelope

public void setEnvelope(Envelope inEnvelope)
                 throws java.lang.Exception
set the envelope of the map. The projection may do some initialization bassed on this value

Specified by:
setEnvelope in interface Projection
Throws:
java.lang.Exception