001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2004, Institut de Recherche pour le Développement
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation;
010: * version 2.1 of the License.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * This package contains documentation from OpenGIS specifications.
018: * OpenGIS consortium's work is fully acknowledged here.
019: */
020: package org.geotools.referencing.cs;
021:
022: // J2SE dependencies
023: import java.util.Map;
024:
025: // OpenGIS dependencies
026: import org.opengis.referencing.cs.CylindricalCS;
027: import org.opengis.referencing.cs.AxisDirection;
028: import org.opengis.referencing.cs.CoordinateSystemAxis;
029:
030: /**
031: * A three-dimensional coordinate system consisting of a
032: * {@linkplain DefaultPolarCS polar coordinate system} extended by a straight
033: * coordinate axis perpendicular to the plane spanned by the polar coordinate system.
034: * A {@code CylindricalCS} shall have three {@linkplain #getAxis axis}.
035: *
036: * <TABLE CELLPADDING='6' BORDER='1'>
037: * <TR BGCOLOR="#EEEEFF"><TH NOWRAP>Used with CRS type(s)</TH></TR>
038: * <TR><TD>
039: * {@link org.geotools.referencing.crs.DefaultEngineeringCRS Engineering}
040: * </TD></TR></TABLE>
041: *
042: * @since 2.1
043: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/cs/DefaultCylindricalCS.java $
044: * @version $Id: DefaultCylindricalCS.java 20874 2006-08-07 10:00:01Z jgarnett $
045: * @author Martin Desruisseaux
046: *
047: * @see DefaultPolarCS
048: */
049: public class DefaultCylindricalCS extends AbstractCS implements
050: CylindricalCS {
051: /**
052: * Serial number for interoperability with different versions.
053: */
054: private static final long serialVersionUID = -8290402732390917907L;
055:
056: /**
057: * Constructs a new coordinate system with the same values than the specified one.
058: * This copy constructor provides a way to wrap an arbitrary implementation into a
059: * Geotools one or a user-defined one (as a subclass), usually in order to leverage
060: * some implementation-specific API. This constructor performs a shallow copy,
061: * i.e. the properties are not cloned.
062: *
063: * @since 2.2
064: */
065: public DefaultCylindricalCS(final CylindricalCS cs) {
066: super (cs);
067: }
068:
069: /**
070: * Constructs a three-dimensional coordinate system from a name.
071: *
072: * @param name The coordinate system name.
073: * @param axis0 The first axis.
074: * @param axis1 The second axis.
075: * @param axis2 The third axis.
076: */
077: public DefaultCylindricalCS(final String name,
078: final CoordinateSystemAxis axis0,
079: final CoordinateSystemAxis axis1,
080: final CoordinateSystemAxis axis2) {
081: super (name, new CoordinateSystemAxis[] { axis0, axis1, axis2 });
082: }
083:
084: /**
085: * Constructs a three-dimensional coordinate system from a set of properties.
086: * The properties map is given unchanged to the
087: * {@linkplain AbstractCS#AbstractCS(Map,CoordinateSystemAxis[]) super-class constructor}.
088: *
089: * @param properties Set of properties. Should contains at least <code>"name"</code>.
090: * @param axis0 The first axis.
091: * @param axis1 The second axis.
092: * @param axis2 The third axis.
093: */
094: public DefaultCylindricalCS(final Map properties,
095: final CoordinateSystemAxis axis0,
096: final CoordinateSystemAxis axis1,
097: final CoordinateSystemAxis axis2) {
098: super (properties, new CoordinateSystemAxis[] { axis0, axis1,
099: axis2 });
100: }
101:
102: /**
103: * Returns {@code true} if the specified axis direction is allowed for this coordinate
104: * system. The default implementation accepts all directions except temporal ones (i.e.
105: * {@link AxisDirection#FUTURE FUTURE} and {@link AxisDirection#PAST PAST}).
106: */
107: protected boolean isCompatibleDirection(
108: final AxisDirection direction) {
109: return !AxisDirection.FUTURE.equals(direction.absolute());
110: }
111: }
|