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    
046    /**
047     * The <code>GeographicCoordinateSystem</code> (in epsg aka Geodetic CRS) is a two dimensional crs with axis of
048     * lat-lon.
049     * 
050     * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
051     * 
052     * @author last edited by: $Author:$
053     * 
054     * @version $Revision:$, $Date:$
055     * 
056     */
057    
058    public class GeographicCRS extends CoordinateSystem {
059    
060        /**
061         * A geographic coordinate system using WGS84 datum. This coordinate system use <var>longitude</var>/<var>latitude</var>
062         * axis with latitude values increasing north and longitude values increasing east. Angular units are degrees and
063         * prime meridian is Greenwich.
064         */
065        public static final GeographicCRS WGS84 = new GeographicCRS( GeodeticDatum.WGS84,
066                                                                     new Axis[] { new Axis( Unit.RADIAN,
067                                                                                            "lon",
068                                                                                            Axis.AO_EAST ),
069                                                                                 new Axis( Unit.RADIAN,
070                                                                                           "lat",
071                                                                                           Axis.AO_NORTH ) },
072                                                                     "EPSG:4326",
073                                                                     "WGS 84" );    
074    
075        /**
076         * A geographic coordinate system using WGS84 datum. This coordinate system use <var>latitude</var>/<var>longitude</var>
077         * axis with latitude values increasing north and longitude values increasing east. Angular units are degrees and
078         * prime meridian is Greenwich.
079         */
080        public static final GeographicCRS WGS84_YX = new GeographicCRS( GeodeticDatum.WGS84,
081                                                                        new Axis[] {
082                                                                                    new Axis( Unit.DEGREE, "lat",
083                                                                                              Axis.AO_NORTH ),
084                                                                                    new Axis( Unit.DEGREE, "lon",
085                                                                                              Axis.AO_EAST ) },
086                                                                        "EPSG:4326", "WGS 84" );
087    
088        /**
089         * @param datum
090         * @param axisOrder
091         * @param identity
092         */
093        public GeographicCRS( GeodeticDatum datum, Axis[] axisOrder, Identifiable identity ) {
094            super( datum, axisOrder, identity );
095        }
096    
097        /**
098         * @param datum
099         * @param axisOrder
100         * @param identifiers
101         * @param names
102         * @param versions
103         * @param descriptions
104         * @param areasOfUse
105         */
106        public GeographicCRS( GeodeticDatum datum, Axis[] axisOrder, String[] identifiers, String[] names,
107                              String[] versions, String[] descriptions, String[] areasOfUse ) {
108            super( datum, axisOrder, identifiers, names, versions, descriptions, areasOfUse );
109        }
110    
111        /**
112         * @param datum
113         * @param axisOrder
114         * @param identifiers
115         * @param name
116         */
117        public GeographicCRS( GeodeticDatum datum, Axis[] axisOrder, String[] identifiers ) {
118            this( datum, axisOrder, identifiers, null, null, null, null );
119        }
120    
121        /**
122         * @param toWGS84
123         * @param datum
124         * @param axisOrder
125         * @param identifier
126         * @param name
127         * @param version
128         * @param description
129         * @param areaOfUse
130         */
131        public GeographicCRS( GeodeticDatum datum, Axis[] axisOrder, String identifier, String name, String version,
132                              String description, String areaOfUse ) {
133            this( datum, axisOrder, new String[] { identifier }, new String[] { name }, new String[] { version },
134                  new String[] { description }, new String[] { areaOfUse } );
135        }
136    
137        /**
138         * @param datum
139         * @param axisOrder
140         * @param identifier
141         * @param name
142         */
143        public GeographicCRS( GeodeticDatum datum, Axis[] axisOrder, String identifier, String name ) {
144            this( datum, axisOrder, new String[] { identifier }, new String[] { name }, null, null, null );
145        }
146    
147        @Override
148        public int getDimension() {
149            return getAxis().length;
150        }
151    
152        @Override
153        public final int getType() {
154            return GEOGRAPHIC_CRS;
155        }
156    
157    }