deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.crs.projections
Class Projection

java.lang.Object
  extended by org.deegree.crs.Identifiable
      extended by org.deegree.crs.projections.Projection
Direct Known Subclasses:
AzimuthalProjection, ConicProjection, CylindricalProjection

public abstract class Projection
extends Identifiable

Map conversion is the process of changing the map grid coordinates (usually, but not always, Eastings & Northings) of a Projected Coordinate Reference System to its corresponding geographical coordinates (Latitude & Longitude) or vice versa.

A projection is conformal if an infinitesimal small perfect circle on the earth's surface results in an infinitesimal small projected perfect circle (an ellisoid with no eccentrity). In other words, the relative local angles about every point on the map are shown correctly.

An equal area projection can be best explained with a coin (Snyder), a coin (of any size) covers exactly the same area of the actual earth as the same coin on any other part of the map. This can only be done by distorting shape, scale and and angles of the original earth's layout.

Version:
$Revision:$, $Date:$
Author:
Rutger Bezema, last edited by: $Author:$

Constructor Summary
Projection(GeographicCRS geographicCRS, double falseNorthing, double falseEasting, javax.vecmath.Point2d naturalOrigin, Unit units, double scale, boolean conformal, boolean equalArea, String[] identifiers, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
          Creates a Projection.
 
Method Summary
abstract  javax.vecmath.Point2d doInverseProjection(double x, double y)
          Do an inverse projection from projected (map) coordinates to geogpraphic coordinates.
abstract  javax.vecmath.Point2d doProjection(double lambda, double phi)
          The actual transform method doing a projection from geographic coordinates to map coordinates.
 boolean equals(Object other)
           
 double getCosphi0()
           
 Datum getDatum()
           
abstract  String getDeegreeSpecificName()
           
 double getEccentricity()
           
 Ellipsoid getEllipsoid()
           
 double getFalseEasting()
           
 double getFalseNorthing()
           
 GeographicCRS getGeographicCRS()
           
 javax.vecmath.Point2d getNaturalOrigin()
           
 PrimeMeridian getPrimeMeridian()
           
 double getProjectionLatitude()
           
 double getProjectionLongitude()
           
 double getScale()
           
 double getScaleFactor()
           
 double getSemiMajorAxis()
           
 double getSemiMinorAxis()
           
 double getSinphi0()
           
 double getSquaredEccentricity()
           
 Unit getUnits()
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 boolean isConformal()
           
 boolean isEqualArea()
           
 boolean isSpherical()
           
 void setFalseEasting(double newFalseEasting)
          sets the false easting to given value.
 void setProjectionLatitude(double projectionLatitude)
          Set the new projection latitude and calculate the sinphi0 and cosPhi0 accordingly
 void setProjectionLongitude(double projectionLongitude)
           
 void setScale(double scale)
          Sets the old scale to the given scale, also adjusts the scaleFactor.
 String toString()
           
 
Methods inherited from class org.deegree.crs.Identifiable
checkForNullObject, checkForNullObject, getAreaOfUse, getAreasOfUse, getDescription, getDescriptions, getIdAndName, getIdentifier, getIdentifiers, getName, getNames, getVersion, getVersions
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Projection

public Projection(GeographicCRS geographicCRS,
                  double falseNorthing,
                  double falseEasting,
                  javax.vecmath.Point2d naturalOrigin,
                  Unit units,
                  double scale,
                  boolean conformal,
                  boolean equalArea,
                  String[] identifiers,
                  String[] names,
                  String[] versions,
                  String[] descriptions,
                  String[] areasOfUse)
Creates a Projection. Causian, the given natural origin should be given in radians rather then degrees.

Parameters:
geographicCRS - which this projection uses.
falseNorthing - in given units
falseEasting - in given units
naturalOrigin - in radians longitude, latitude.
units - of the map projection
scale - at the prime meridian (eg. 0.9996 for UTM)
conformal - if the projection is conformal
equalArea - if the projection result in an equal area map
identifiers -
names -
versions -
descriptions -
areasOfUse -
Method Detail

doProjection

public abstract javax.vecmath.Point2d doProjection(double lambda,
                                                   double phi)
                                            throws CRSException
The actual transform method doing a projection from geographic coordinates to map coordinates.

Parameters:
lambda - the longitude
phi - the latitude
Returns:
the projected Point or Point(Double.NAN, Double.NAN) if an error occurred.
Throws:
CRSException

doInverseProjection

public abstract javax.vecmath.Point2d doInverseProjection(double x,
                                                          double y)
                                                   throws CRSException
Do an inverse projection from projected (map) coordinates to geogpraphic coordinates.

Parameters:
x - coordinate on the map
y - coordinate on the map
Returns:
the projected Point with x = lambda and y = phi, or Point(Double.NAN, Double.NAN) if an error occurred.
Throws:
CRSException

getDeegreeSpecificName

public abstract String getDeegreeSpecificName()
Returns:
A deegree specific name which will be used for exportation of a projection.

isConformal

public final boolean isConformal()
Returns:
true if the projection projects conformal.

isEqualArea

public final boolean isEqualArea()
Returns:
true if the projection is projects equal Area.

getScale

public final double getScale()
Returns:
the scale.

setScale

public void setScale(double scale)
Sets the old scale to the given scale, also adjusts the scaleFactor.

Parameters:
scale - the new scale

getScaleFactor

public final double getScaleFactor()
Returns:
the scale*semimajor-axis, often revered to as R*k_0 in Snyder.

getDatum

public final Datum getDatum()
Returns:
the datum.

getFalseEasting

public final double getFalseEasting()
Returns:
the falseEasting.

setFalseEasting

public void setFalseEasting(double newFalseEasting)
sets the false easting to given value. (Used in for example transverse mercator, while setting the utm zone).

Parameters:
newFalseEasting - the new false easting parameter.

getFalseNorthing

public final double getFalseNorthing()
Returns:
the falseNorthing.

getNaturalOrigin

public final javax.vecmath.Point2d getNaturalOrigin()
Returns:
the naturalOrigin.

getUnits

public final Unit getUnits()
Returns:
the units.

getPrimeMeridian

public final PrimeMeridian getPrimeMeridian()
Returns:
the primeMeridian of the datum.

getEllipsoid

public final Ellipsoid getEllipsoid()
Returns:
the ellipsoid of the datum.

getEccentricity

public final double getEccentricity()
Returns:
the eccentricity of the ellipsoid of the datum.

getSquaredEccentricity

public final double getSquaredEccentricity()
Returns:
the eccentricity of the ellipsoid of the datum.

getSemiMajorAxis

public final double getSemiMajorAxis()
Returns:
the semiMajorAxis (a) of the ellipsoid of the datum.

getSemiMinorAxis

public final double getSemiMinorAxis()
Returns:
the semiMinorAxis (a) of the ellipsoid of the datum.

isSpherical

public final boolean isSpherical()
Returns:
true if the ellipsoid of the datum is a sphere and not an ellipse.

setProjectionLatitude

public final void setProjectionLatitude(double projectionLatitude)
Set the new projection latitude and calculate the sinphi0 and cosPhi0 accordingly

Parameters:
projectionLatitude - the new latitude.

setProjectionLongitude

public final void setProjectionLongitude(double projectionLongitude)
Parameters:
projectionLongitude - the new projection longitude

getProjectionLatitude

public final double getProjectionLatitude()
Returns:
the projectionLatitude also known as central-latitude or latitude-of-origin, in Snyder referenced as phi_1 for azimuthal, phi_0 for other projections.

getProjectionLongitude

public final double getProjectionLongitude()
Returns:
the projectionLongitude also known as projection-meridian or central-meridian, in Snyder referenced as lambda_0

getSinphi0

public final double getSinphi0()
Returns:
the sinphi0, the sine of the projection latitude

getCosphi0

public final double getCosphi0()
Returns:
the cosphi0, the cosine of the projection latitude

getGeographicCRS

public final GeographicCRS getGeographicCRS()
Returns:
the geographicCRS.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Identifiable

hashCode

public int hashCode()
Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast. It is created from field f as follows:

Combining the hash code(s) computed above: result = 37 * result + code;

Overrides:
hashCode in class Object
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

deegree 2.2 (2008/12/22 11:33 build-3038-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net