KickJava   Java API By Example, From Geeks To Geeks.

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


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.SI;
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 3 dimensional spatial reference system.
25  *
26  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
27  * @version 3.0, February 13, 2006
28  */

29 public abstract class GeocentricCRS<C extends Coordinates> extends
30         CoordinateReferenceSystem<C> {
31
32     /**
33      * Holds the XYZ coordinate system.
34      */

35     public static final CoordinateSystem XYZ_CS = new CoordinateSystem() {
36
37         Axis xAxis = new Axis("Geocentric X", "X", SI.METER,
38                 AxisDirection.GEOCENTRIC_X);
39
40         Axis yAxis = new Axis("Geocentric Y", "Y", SI.METER,
41                 AxisDirection.GEOCENTRIC_Y);
42
43         Axis zAxis = new Axis("Geocentric Z", "Z", SI.METER,
44                 AxisDirection.GEOCENTRIC_Z);
45
46         public int getDimension() {
47             return 3;
48         }
49
50         public CoordinateSystemAxis getAxis(int dimension)
51                 throws IndexOutOfBoundsException JavaDoc {
52             if (dimension == 0) {
53                 return xAxis;
54             } else if (dimension == 1) {
55                 return yAxis;
56             } else if (dimension == 2) {
57                 return zAxis;
58             } else {
59                 throw new IndexOutOfBoundsException JavaDoc();
60             }
61         }
62
63         public Identifier getName() {
64             throw new UnsupportedOperationException JavaDoc();
65         }
66
67         public Collection JavaDoc getAlias() {
68             return EMPTY_SET;
69         }
70
71         public Set JavaDoc getIdentifiers() {
72             return EMPTY_SET;
73         }
74
75         public InternationalString getRemarks() {
76             throw new UnsupportedOperationException JavaDoc();
77         }
78
79         public String JavaDoc toWKT() throws UnsupportedOperationException JavaDoc {
80             throw new UnsupportedOperationException JavaDoc();
81         }
82     };
83
84
85 }
Popular Tags