01: /*
02: * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
03: * Copyright (C) 2006 - JScience (http://jscience.org/)
04: * All rights reserved.
05: *
06: * Permission to use, copy, modify, and distribute this software is
07: * freely granted, provided that this notice is preserved.
08: */
09: package org.jscience.geography.coordinates.crs;
10:
11: import java.util.Collection;
12: import java.util.Set;
13:
14: import javax.measure.unit.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.METRE,
38: AxisDirection.GEOCENTRIC_X);
39:
40: Axis yAxis = new Axis("Geocentric Y", "Y", SI.METRE,
41: AxisDirection.GEOCENTRIC_Y);
42:
43: Axis zAxis = new Axis("Geocentric Z", "Z", SI.METRE,
44: AxisDirection.GEOCENTRIC_Z);
45:
46: public int getDimension() {
47: return 3;
48: }
49:
50: public CoordinateSystemAxis getAxis(int dimension)
51: throws IndexOutOfBoundsException {
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();
60: }
61: }
62:
63: public Identifier getName() {
64: throw new UnsupportedOperationException();
65: }
66:
67: public Collection<String> getAlias() {
68: return EMPTY_SET;
69: }
70:
71: public Set<String> getIdentifiers() {
72: return EMPTY_SET;
73: }
74:
75: public InternationalString getRemarks() {
76: throw new UnsupportedOperationException();
77: }
78:
79: public String toWKT() throws UnsupportedOperationException {
80: throw new UnsupportedOperationException();
81: }
82: };
83:
84: }
|