deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.crs.projections
Class Projection

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

public abstract class Projection
extends Identifiable
implements java.io.Serializable

Map conversion is the process of changing the map grid coordinates (usually, but not always, Easting & Northing) 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 ellipsoid with no eccentricity). 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: 18222 $, $Date: 2009-06-22 14:42:54 +0200 (Mo, 22 Jun 2009) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $
See Also:
Serialized Form

Constructor Summary
Projection(GeographicCRS geographicCRS, double falseNorthing, double falseEasting, javax.vecmath.Point2d naturalOrigin, Unit units, double scale, boolean conformal, boolean equalArea, Identifiable id)
          Creates a Projection.
 
Method Summary
abstract  javax.vecmath.Point2d doInverseProjection(double x, double y)
          Do an inverse projection from projected (map) coordinates to geographic 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(java.lang.Object other)
           
 double getCosphi0()
           
 Datum getDatum()
           
 double getEccentricity()
           
 Ellipsoid getEllipsoid()
           
 double getFalseEasting()
           
 double getFalseNorthing()
           
 GeographicCRS getGeographicCRS()
           
abstract  java.lang.String getImplementationName()
           
 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 setScale(double scale)
          Sets the old scale to the given scale, also adjusts the scaleFactor.
 java.lang.String toString()
           
 
Methods inherited from class org.deegree.crs.Identifiable
checkForNullObject, checkForNullObject, checkForNullObject, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getDescription, getDescriptions, getIdAndName, getIdentifier, getIdentifiers, getName, getNames, getVersion, getVersions, hasID
 
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,
                  Identifiable id)
Creates a Projection. Caution, 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 (e.g. 0.9996 for UTM)
conformal - if the projection is conformal
equalArea - if the projection result in an equal area map
id - an identifiable instance containing information about this projection.
Method Detail

doProjection

public abstract javax.vecmath.Point2d doProjection(double lambda,
                                                   double phi)
                                            throws ProjectionException
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:
ProjectionException - if the given lamba and phi coordinates could not be projected to x and y.

doInverseProjection

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

Parameters:
x - coordinate on the map
y - coordinate on the map
Returns:
the projected Point with x = lambda and y = phi;
Throws:
ProjectionException - if the given x and y coordinates could not be inverted to lambda and phi.

getImplementationName

public abstract java.lang.String getImplementationName()
Returns:
A deegree specific name which will be used for the export 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.

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(java.lang.Object other)
Overrides:
equals in class Identifiable

toString

public java.lang.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 java.lang.Object
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

deegree 2.5 (2011/06/29 09:44 build-8-official)

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