001 //$HeadURL: http://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/model/crs/CoordinateSystem.java $
002 /*----------------------------------------------------------------------------
003 This file is part of deegree, http://deegree.org/
004 Copyright (C) 2001-2009 by:
005 Department of Geography, University of Bonn
006 and
007 lat/lon GmbH
008
009 This library is free software; you can redistribute it and/or modify it under
010 the terms of the GNU Lesser General Public License as published by the Free
011 Software Foundation; either version 2.1 of the License, or (at your option)
012 any later version.
013 This library is distributed in the hope that it will be useful, but WITHOUT
014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016 details.
017 You should have received a copy of the GNU Lesser General Public License
018 along with this library; if not, write to the Free Software Foundation, Inc.,
019 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020
021 Contact information:
022
023 lat/lon GmbH
024 Aennchenstr. 19, 53177 Bonn
025 Germany
026 http://lat-lon.de/
027
028 Department of Geography, University of Bonn
029 Prof. Dr. Klaus Greve
030 Postfach 1147, 53001 Bonn
031 Germany
032 http://www.geographie.uni-bonn.de/deegree/
033
034 e-mail: info@deegree.org
035 ----------------------------------------------------------------------------*/
036 package org.deegree.model.crs;
037
038 // OpenGIS dependencies
039 import org.deegree.crs.components.Unit;
040 import org.deegree.datatypes.QualifiedName;
041
042 /**
043 * A coordinate system is a mathematical space, where the elements of the space are called positions. Each position is
044 * described by a list of numbers. The length of the list corresponds to the dimension of the coordinate system. So in a
045 * 2D coordinate system each position is described by a list containing 2 numbers. <br>
046 * <br>
047 * However, in a coordinate system, not all lists of numbers correspond to a position - some lists may be outside the
048 * domain of the coordinate system. For example, in a 2D Lat/Lon coordinate system, the list (91,91) does not correspond
049 * to a position. <br>
050 * <br>
051 * Some coordinate systems also have a mapping from the mathematical space into locations in the real world. So in a
052 * Lat/Lon coordinate system, the mathematical position (lat, long) corresponds to a location on the surface of the
053 * Earth. This mapping from the mathematical space into real-world locations is called a Datum.
054 *
055 * @version $Revision: 29964 $
056 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
057 * @author last edited by: $Author: apoth $
058 *
059 * @version 1.0. $Revision: 29964 $, $Date: 2011-03-09 15:02:12 +0100 (Wed, 09 Mar 2011) $
060 *
061 * @since 2.0
062 */
063 public class CoordinateSystem extends QualifiedName {
064
065 /**
066 *
067 */
068 private static final long serialVersionUID = -170831086069691683L;
069
070 private org.deegree.crs.coordinatesystems.CoordinateSystem realCRS;
071
072 private final String requestedID;
073
074 /**
075 * Creates a CoordinateSystem as a wrapper to the real CRS.
076 *
077 * @param realCRS
078 */
079 CoordinateSystem( org.deegree.crs.coordinatesystems.CoordinateSystem realCRS, String requestedID ) {
080 super( realCRS.getIdentifier() );
081 this.realCRS = realCRS;
082 this.requestedID = requestedID;
083 }
084
085 /**
086 * @param realCRS
087 * to wrap
088 */
089 public CoordinateSystem( org.deegree.crs.coordinatesystems.CoordinateSystem realCRS ) {
090 this( realCRS, realCRS.getIdentifier() );
091 }
092
093 /**
094 * This method returns the requested id (given in the constructor) and not the
095 * {@link org.deegree.crs.coordinatesystems.CoordinateSystem#getIdentifier()} which only returns the first
096 * configured id.
097 *
098 * @return the requested id.
099 */
100 public String getIdentifier() {
101 return requestedID;
102 }
103
104 /**
105 * Since the crs uses a different namespace system as {@link QualifiedName} this method only returns the
106 * {@link #getIdentifier()}.
107 */
108 @Override
109 public String getPrefixedName() {
110 return getIdentifier();
111 }
112
113 /**
114 * @return the units of all axis.
115 */
116 public Unit[] getAxisUnits() {
117 return realCRS.getUnits();
118 }
119
120 /**
121 * @return the dimension of the encapsulated CRS
122 */
123 public int getDimension() {
124 return realCRS.getDimension();
125 }
126
127 /**
128 * @return the encapsulated CRS.
129 */
130 public org.deegree.crs.coordinatesystems.CoordinateSystem getCRS() {
131 return realCRS;
132 }
133
134 @Override
135 public boolean equals( Object other ) {
136 if ( other != null && other instanceof CoordinateSystem ) {
137 final CoordinateSystem that = (CoordinateSystem) other;
138 return this.realCRS.equals( that.realCRS );
139 }
140 return false;
141 }
142 }