org.deegree.cs
Class CRS

java.lang.Object
  extended by org.deegree.cs.CRS
All Implemented Interfaces:
java.io.Serializable

public class CRS
extends java.lang.Object
implements java.io.Serializable

Represents the name to a CRS that is not necessarily resolved or resolvable.

Their are two aspects that this class takes care of:

  • In most use cases, coordinate reference system are identified using strings (such as 'EPSG:4326'). However, there are multiple equivalent ways to encode coordinate reference system identifications (another one would be 'urn:ogc:def:crs:EPSG::4326'). By using this class to represent a CRS, the original spelling is maintained.
  • A coordinate reference system may be specified which is not known to the CRSRegistry. However, for some operations this is not a necessarily a problem, e.g. a GML document may be read and transformed into Feature and Geometry objects.
  • Version:
    $Revision: $, $Date: $
    Author:
    Andrei Ionita, last edited by: $Author: ionita $
    See Also:
    Serialized Form

    Field Summary
    static CRS EPSG_4326
              The commonly used geographic 'EPSG:4326', with axis order X, Y.
     
    Constructor Summary
    CRS(CoordinateSystem crs)
              Creates a new CRS instance with the given coordinate system.
    CRS(java.io.File prj)
              Try to read a crs from the given (prj) file which is supposed to define a WKT definition.
    CRS(java.lang.String crsName)
              Creates a new CRS instance with a coordinate reference system name.
    CRS(java.lang.String crsName, boolean forceXY)
              Creates a new CRS instance with a coordinate reference system name.
     
    Method Summary
     boolean equals(java.lang.Object other)
               
     double[] getAreaOfUse()
              Returns the area of use, i.e. the domain where this CRSIdentifiable is valid.
     java.lang.String getName()
              Returns the string that identifies the CRS.
     CoordinateSystem getWrappedCRS()
              Returns the corresponding CRS object.
     int hashCode()
               
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
     

    Field Detail

    EPSG_4326

    public static final CRS EPSG_4326
    The commonly used geographic 'EPSG:4326', with axis order X, Y.

    Constructor Detail

    CRS

    public CRS(java.lang.String crsName)
    Creates a new CRS instance with a coordinate reference system name.

    Parameters:
    crsName - name of the crs (identification string) or null

    CRS

    public CRS(java.lang.String crsName,
               boolean forceXY)
    Creates a new CRS instance with a coordinate reference system name.

    Parameters:
    crsName - name of the crs (identification string) or null
    forceXY - true if the axis order of the coordinate system should be x/y (EAST/NORTH; WEST/SOUTH); false id the defined axis order should be taken

    CRS

    public CRS(CoordinateSystem crs)
    Creates a new CRS instance with the given coordinate system.

    Parameters:
    crs -

    CRS

    public CRS(java.io.File prj)
        throws java.io.IOException
    Try to read a crs from the given (prj) file which is supposed to define a WKT definition.

    Parameters:
    prj - a file containing a wkt representation of the coordinate system.
    Throws:
    java.io.IOException
    Method Detail

    getName

    public java.lang.String getName()
    Returns the string that identifies the CRS.

    Returns:
    the string that identifies the coordinate reference system

    getWrappedCRS

    public CoordinateSystem getWrappedCRS()
                                   throws UnknownCRSException
    Returns the corresponding CRS object.

    Returns:
    the coordinate reference system, or null if the name is null
    Throws:
    UnknownCRSException

    equals

    public boolean equals(java.lang.Object other)
    Overrides:
    equals in class java.lang.Object

    hashCode

    public int hashCode()
    Overrides:
    hashCode in class java.lang.Object

    getAreaOfUse

    public double[] getAreaOfUse()
                          throws UnknownCRSException
    Returns the area of use, i.e. the domain where this CRSIdentifiable is valid.

    Returns:
    the domain of validity (EPSG:4326 coordinates), order: minX, minY, maxX, maxY, never null (-180,-90,180,90) if no such information is available
    Throws:
    UnknownCRSException

    toString

    public java.lang.String toString()
    Overrides:
    toString in class java.lang.Object


    Copyright © 2011. All Rights Reserved.