org.deegree.cs.coordinatesystems
Class ProjectedCRS

java.lang.Object
  extended by org.deegree.cs.CRSIdentifiable
      extended by org.deegree.cs.coordinatesystems.CRS
          extended by org.deegree.cs.coordinatesystems.ProjectedCRS
All Implemented Interfaces:
Object, TypedObjectNode, ICRS, IProjectedCRS, CRSResource

public class ProjectedCRS
extends CRS
implements IProjectedCRS

A ProjectedCRS is a coordinatesystem defined with a projection and a geographic crs. It allows for transformation between projected coordinates (mostly in meters) and the lat/lon coordinates of the geographic crs and vice versa.

Version:
$Revision: 30961 $, $Date: 2011-05-30 13:12:58 +0200 (Mon, 30 May 2011) $
Author:
Rutger Bezema, last edited by: $Author: lbuesching $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deegree.cs.coordinatesystems.CRS
CRS.CRSType
 
Constructor Summary
ProjectedCRS(IProjection projection, IGeographicCRS geographicCRS, IAxis[] axisOrder, CRSCodeType code)
           
ProjectedCRS(IProjection projection, IGeographicCRS geographicCRS, IAxis[] axisOrder, CRSCodeType[] codes)
           
ProjectedCRS(IProjection projection, IGeographicCRS geographicCRS, IAxis[] axisOrder, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
           
ProjectedCRS(IProjection projection, IGeographicCRS geographicCRS, IAxis[] axisOrder, CRSCodeType code, String name, String version, String description, String areaOfUse)
           
ProjectedCRS(IProjection projection, IGeographicCRS geographicCRS, IAxis[] axisOrder, CRSResource identity)
           
ProjectedCRS(List<Transformation> transformations, IGeographicCRS geographicCRS, IProjection projection, IAxis[] axisOrder, CRSResource identity)
           
 
Method Summary
 javax.vecmath.Point2d doInverseProjection(double x, double y)
          Do an inverse projection from projected (map) coordinates to geographic coordinates.
 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)
           
 boolean equalsWithFlippedAxis(Object other)
          TODO: this methode should become redundant with the reworked identifer concept!
 int getDimension()
           
 IGeographicCRS getGeographicCRS()
           
 IProjection getProjection()
           
 CRS.CRSType getType()
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 String toString()
           
 
Methods inherited from class org.deegree.cs.coordinatesystems.CRS
convertToAxis, getAlias, getAxis, getDatum, getDirectTransformation, getEasting, getGeodeticDatum, getNorthing, getTransformations, getTypeName, getUnits, getValidDomain, hasDirectTransformation
 
Methods inherited from class org.deegree.cs.CRSIdentifiable
addAreaOfUse, addName, checkForNullObject, checkForNullObject, checkForNullObject, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getId, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.cs.coordinatesystems.ICRS
convertToAxis, getAlias, getAxis, getDatum, getDirectTransformation, getEasting, getGeodeticDatum, getNorthing, getTransformations, getUnits, getValidDomain, hasDirectTransformation
 
Methods inherited from interface org.deegree.cs.CRSResource
addAreaOfUse, addName, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion
 
Methods inherited from interface org.deegree.commons.tom.Object
getId
 

Constructor Detail

ProjectedCRS

public ProjectedCRS(IProjection projection,
                    IGeographicCRS geographicCRS,
                    IAxis[] axisOrder,
                    CRSResource identity)
Parameters:
projection - the projection which converts coordinates from this ProjectedCRS into the underlying GeographicCRS and vice versa.
axisOrder - of this projection.
identity -

ProjectedCRS

public ProjectedCRS(IProjection projection,
                    IGeographicCRS geographicCRS,
                    IAxis[] axisOrder,
                    CRSCodeType[] codes,
                    String[] names,
                    String[] versions,
                    String[] descriptions,
                    String[] areasOfUse)
Parameters:
projection - the projection which converts coordinates from this ProjectedCRS into the underlying GeographicCRS and vice versa.
axisOrder - of this projection.
codes -
names -
versions -
descriptions -
areasOfUse -

ProjectedCRS

public ProjectedCRS(IProjection projection,
                    IGeographicCRS geographicCRS,
                    IAxis[] axisOrder,
                    CRSCodeType[] codes)
Parameters:
projection - the projection which converts coordinates from this ProjectedCRS into the underlying GeographicCRS and vice versa.
axisOrder - of this projection.
codes -

ProjectedCRS

public ProjectedCRS(IProjection projection,
                    IGeographicCRS geographicCRS,
                    IAxis[] axisOrder,
                    CRSCodeType code,
                    String name,
                    String version,
                    String description,
                    String areaOfUse)
Parameters:
projection - the projection which converts coordinates from this ProjectedCRS into the underlying GeographicCRS and vice versa.
axisOrder - of this projection.
code -
name -
version -
description -
areaOfUse -

ProjectedCRS

public ProjectedCRS(IProjection projection,
                    IGeographicCRS geographicCRS,
                    IAxis[] axisOrder,
                    CRSCodeType code)
Parameters:
projection - the projection which converts coordinates from this ProjectedCRS into the underlying GeographicCRS and vice versa.
axisOrder - of this projection.
code -

ProjectedCRS

public ProjectedCRS(List<Transformation> transformations,
                    IGeographicCRS geographicCRS,
                    IProjection projection,
                    IAxis[] axisOrder,
                    CRSResource identity)
Parameters:
transformations - to use instead of the helmert transformation.
projection - the projection which converts coordinates from this ProjectedCRS into the underlying GeographicCRS and vice versa.
axisOrder - of this projection.
identity -
Method Detail

getDimension

public int getDimension()
Specified by:
getDimension in interface ICRS
Returns:
the dimension of this CRS.

getGeographicCRS

public final IGeographicCRS getGeographicCRS()
Specified by:
getGeographicCRS in interface IProjectedCRS
Returns:
the underlyingCRS.

getType

public final CRS.CRSType getType()
Specified by:
getType in interface ICRS
Returns:
one of the *_CRS types defined in this class.

getProjection

public final IProjection getProjection()
Specified by:
getProjection in interface IProjectedCRS
Returns:
the projection.

doProjection

public javax.vecmath.Point2d doProjection(double lambda,
                                          double phi)
                                   throws ProjectionException
Description copied from interface: IProjectedCRS
The actual transform method doing a projection from geographic coordinates to map coordinates.

Specified by:
doProjection in interface IProjectedCRS
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 javax.vecmath.Point2d doInverseProjection(double x,
                                                 double y)
                                          throws ProjectionException
Description copied from interface: IProjectedCRS
Do an inverse projection from projected (map) coordinates to geographic coordinates.

Specified by:
doInverseProjection in interface IProjectedCRS
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.

equals

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

toString

public String toString()
Overrides:
toString in class CRS

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

equalsWithFlippedAxis

public boolean equalsWithFlippedAxis(Object other)
Description copied from interface: ICRS
TODO: this methode should become redundant with the reworked identifer concept!

Specified by:
equalsWithFlippedAxis in interface ICRS
Overrides:
equalsWithFlippedAxis in class CRS
Returns:
true, if this and other are from the same type differes only in a flipped axis order.


Copyright © 2011. All Rights Reserved.