KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jscience > geography > coordinates > crs > GeographicCRS


1 /*
2  * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
3  * Copyright (C) 2006 - JScience (http://jscience.org/)
4  * All rights reserved.
5  *
6  * Permission to use, copy, modify, and distribute this software is
7  * freely granted, provided that this notice is preserved.
8  */

9 package org.jscience.geography.coordinates.crs;
10
11 import java.util.Collection JavaDoc;
12 import java.util.Set JavaDoc;
13
14 import javax.measure.units.NonSI;
15
16 import org.jscience.geography.coordinates.Coordinates;
17 import org.opengis.metadata.Identifier;
18 import org.opengis.referencing.cs.AxisDirection;
19 import org.opengis.referencing.cs.CoordinateSystem;
20 import org.opengis.referencing.cs.CoordinateSystemAxis;
21 import org.opengis.util.InternationalString;
22
23 /**
24  * This class represents a 2 dimensional surface reference system
25  * based on an ellipsoidal approximation of a geoid.
26  *
27  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
28  * @version 3.0, February 13, 2006
29  */

30 public abstract class GeographicCRS<C extends Coordinates> extends CoordinateReferenceSystem<C> {
31
32     /**
33      * Holds the Geodetic Latitude/Longitude coordinate system.
34      */

35     public static final CoordinateSystem LATITUDE_LONGITUDE_CS = new CoordinateSystem() {
36
37         Axis latitudeAxis = new Axis("Geodetic Latitude", "Lat", NonSI.DEGREE_ANGLE,
38                 AxisDirection.NORTH);
39
40         Axis longitudeAxis = new Axis("Geodetic Longitude", "Long", NonSI.DEGREE_ANGLE,
41                 AxisDirection.EAST);
42         
43         public int getDimension() {
44             return 2;
45         }
46
47         public CoordinateSystemAxis getAxis(int dimension)
48                 throws IndexOutOfBoundsException JavaDoc {
49             if (dimension == 0) {
50                 return latitudeAxis;
51             } else if (dimension == 1) {
52                 return longitudeAxis;
53             } else {
54                 throw new IndexOutOfBoundsException JavaDoc();
55             }
56         }
57
58         public Identifier getName() {
59             throw new UnsupportedOperationException JavaDoc();
60         }
61
62         public Collection JavaDoc getAlias() {
63             return EMPTY_SET;
64         }
65
66         public Set JavaDoc getIdentifiers() {
67             return EMPTY_SET;
68         }
69
70         public InternationalString getRemarks() {
71             throw new UnsupportedOperationException JavaDoc();
72         }
73
74         public String JavaDoc toWKT() throws UnsupportedOperationException JavaDoc {
75             throw new UnsupportedOperationException JavaDoc();
76         }
77     };
78
79 }
Popular Tags