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.PolarCS;
027: import org.opengis.referencing.cs.AxisDirection;
028: import org.opengis.referencing.cs.CoordinateSystemAxis;
029:
030: /**
031: * A two-dimensional coordinate system in which position is specified by the distance from the
032: * origin and the angle between the line from the origin to a point and a reference direction.
033: * A {@code PolarCS} shall have two {@linkplain #getAxis axis}.
034: *
035: * <TABLE CELLPADDING='6' BORDER='1'>
036: * <TR BGCOLOR="#EEEEFF"><TH NOWRAP>Used with CRS type(s)</TH></TR>
037: * <TR><TD>
038: * {@link org.geotools.referencing.crs.DefaultEngineeringCRS Engineering}
039: * </TD></TR></TABLE>
040: *
041: * @since 2.1
042: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/cs/DefaultPolarCS.java $
043: * @version $Id: DefaultPolarCS.java 20874 2006-08-07 10:00:01Z jgarnett $
044: * @author Martin Desruisseaux
045: *
046: * @see DefaultCylindricalCS
047: */
048: public class DefaultPolarCS extends AbstractCS implements PolarCS {
049: /**
050: * Serial number for interoperability with different versions.
051: */
052: private static final long serialVersionUID = 3960197260975470951L;
053:
054: /**
055: * Constructs a new coordinate system with the same values than the specified one.
056: * This copy constructor provides a way to wrap an arbitrary implementation into a
057: * Geotools one or a user-defined one (as a subclass), usually in order to leverage
058: * some implementation-specific API. This constructor performs a shallow copy,
059: * i.e. the properties are not cloned.
060: *
061: * @since 2.2
062: */
063: public DefaultPolarCS(final PolarCS cs) {
064: super (cs);
065: }
066:
067: /**
068: * Constructs a two-dimensional coordinate system from a name.
069: *
070: * @param name The coordinate system name.
071: * @param axis0 The first axis.
072: * @param axis1 The second axis.
073: */
074: public DefaultPolarCS(final String name,
075: final CoordinateSystemAxis axis0,
076: final CoordinateSystemAxis axis1) {
077: super (name, new CoordinateSystemAxis[] { axis0, axis1 });
078: }
079:
080: /**
081: * Constructs a two-dimensional coordinate system from a set of properties.
082: * The properties map is given unchanged to the
083: * {@linkplain AbstractCS#AbstractCS(Map,CoordinateSystemAxis[]) super-class constructor}.
084: *
085: * @param properties Set of properties. Should contains at least <code>"name"</code>.
086: * @param axis0 The first axis.
087: * @param axis1 The second axis.
088: */
089: public DefaultPolarCS(final Map properties,
090: final CoordinateSystemAxis axis0,
091: final CoordinateSystemAxis axis1) {
092: super (properties, new CoordinateSystemAxis[] { axis0, axis1 });
093: }
094:
095: /**
096: * Returns {@code true} if the specified axis direction is allowed for this coordinate
097: * system. The default implementation accepts all directions except temporal ones (i.e.
098: * {@link AxisDirection#FUTURE FUTURE} and {@link AxisDirection#PAST PAST}).
099: */
100: protected boolean isCompatibleDirection(
101: final AxisDirection direction) {
102: return !AxisDirection.FUTURE.equals(direction.absolute());
103: }
104: }
|