001: //$HeadURL: $
002: /*---------------- FILE HEADER ------------------------------------------
003: This file is part of deegree.
004: Copyright (C) 2001-2008 by:
005: Department of Geography, University of Bonn
006: http://www.giub.uni-bonn.de/deegree/
007: lat/lon GmbH
008: http://www.lat-lon.de
009:
010: This library is free software; you can redistribute it and/or
011: modify it under the terms of the GNU Lesser General Public
012: License as published by the Free Software Foundation; either
013: version 2.1 of the License, or (at your option) any later version.
014: This library is distributed in the hope that it will be useful,
015: but WITHOUT ANY WARRANTY; without even the implied warranty of
016: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: Lesser General Public License for more details.
018: You should have received a copy of the GNU Lesser General Public
019: License along with this library; if not, write to the Free Software
020: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
021: Contact:
022:
023: Andreas Poth
024: lat/lon GmbH
025: Aennchenstr. 19
026: 53177 Bonn
027: Germany
028: E-Mail: poth@lat-lon.de
029:
030: Prof. Dr. Klaus Greve
031: Department of Geography
032: University of Bonn
033: Meckenheimer Allee 166
034: 53115 Bonn
035: Germany
036: E-Mail: greve@giub.uni-bonn.de
037: ---------------------------------------------------------------------------*/
038:
039: package org.deegree.crs.coordinatesystems;
040:
041: import org.deegree.crs.Identifiable;
042: import org.deegree.crs.components.Axis;
043: import org.deegree.crs.components.GeodeticDatum;
044: import org.deegree.crs.components.Unit;
045: import org.deegree.i18n.Messages;
046:
047: /**
048: * The <code>GeographicCoordinateSystem</code> (in epsg aka Geodetic CRS) is a two dimensional crs with axis of
049: * lat-lon.
050: *
051: * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
052: *
053: * @author last edited by: $Author:$
054: *
055: * @version $Revision:$, $Date:$
056: *
057: */
058:
059: public class GeographicCRS extends CoordinateSystem {
060:
061: /**
062: * A geographic coordinate system using WGS84 datum. This coordinate system use <var>longitude</var>/<var>latitude</var>
063: * axis with latitude values increasing north and longitude values increasing east. Angular units are degrees and
064: * prime meridian is Greenwich.
065: */
066: public static final GeographicCRS WGS84 = new GeographicCRS(
067: GeodeticDatum.WGS84, new Axis[] {
068: new Axis(Unit.DEGREE, "lon", Axis.AO_EAST),
069: new Axis(Unit.DEGREE, "lat", Axis.AO_NORTH) },
070: "EPSG:4326", "WGS 84");
071:
072: /**
073: * @param datum
074: * @param axisOrder
075: * @param identity
076: * @throws IllegalArgumentException
077: * if the axisOrder.length != 2.
078: */
079: public GeographicCRS(GeodeticDatum datum, Axis[] axisOrder,
080: Identifiable identity) throws IllegalArgumentException {
081: super (datum, axisOrder, identity);
082: if (axisOrder.length != 2) {
083: throw new IllegalArgumentException(Messages.getMessage(
084: "CRS_COORDINATESYSTEMS_WRONG_AXIS_DIM",
085: "Geographic", "2"));
086: }
087: }
088:
089: /**
090: * @param datum
091: * @param axisOrder
092: * @param identifiers
093: * @param names
094: * @param versions
095: * @param descriptions
096: * @param areasOfUse
097: * @throws IllegalArgumentException
098: * if the axisOrder.length != 2.
099: */
100: public GeographicCRS(GeodeticDatum datum, Axis[] axisOrder,
101: String[] identifiers, String[] names, String[] versions,
102: String[] descriptions, String[] areasOfUse)
103: throws IllegalArgumentException {
104: super (datum, axisOrder, identifiers, names, versions,
105: descriptions, areasOfUse);
106: if (axisOrder.length != 2) {
107: throw new IllegalArgumentException(Messages.getMessage(
108: "CRS_COORDINATESYSTEMS_WRONG_AXIS_DIM",
109: "Geographic", "2"));
110: }
111: }
112:
113: /**
114: * @param datum
115: * @param axisOrder
116: * @param identifiers
117: */
118: public GeographicCRS(GeodeticDatum datum, Axis[] axisOrder,
119: String[] identifiers) {
120: this (datum, axisOrder, identifiers, null, null, null, null);
121: }
122:
123: /**
124: * @param datum
125: * @param axisOrder
126: * @param identifier
127: * @param name
128: * @param version
129: * @param description
130: * @param areaOfUse
131: */
132: public GeographicCRS(GeodeticDatum datum, Axis[] axisOrder,
133: String identifier, String name, String version,
134: String description, String areaOfUse) {
135: this (datum, axisOrder, new String[] { identifier },
136: new String[] { name }, new String[] { version },
137: new String[] { description },
138: new String[] { areaOfUse });
139: }
140:
141: /**
142: * @param datum
143: * @param axisOrder
144: * @param identifier
145: * @param name
146: */
147: public GeographicCRS(GeodeticDatum datum, Axis[] axisOrder,
148: String identifier, String name) {
149: this (datum, axisOrder, new String[] { identifier },
150: new String[] { name }, null, null, null);
151: }
152:
153: @Override
154: public int getDimension() {
155: return 2;
156: }
157:
158: @Override
159: public int getType() {
160: return GEOGRAPHIC_CRS;
161: }
162:
163: }
|