public class AbstractCS extends AbstractIdentifiedObject implements CoordinateSystem
This class is conceptually abstract, even if it is technically possible to instantiate it.
Typical applications should create instances of the most specific subclass with Default prefix instead.
An exception to this rule may occurs when it is not possible to identify the exact type. For example it is not
possible to infer the exact coordinate system from Well Known Text (WKT) version 1 in some cases
(e.g. in a LOCAL_CS element). In such exceptional situation, a plain AbstractCS object may be
instantiated.
CoordinateSystemAxis instances given to the constructor are also immutable. Most SIS subclasses and
related classes are immutable under similar conditions. This means that unless otherwise noted in the javadoc,
CoordinateSystem instances created using only SIS factories and static constants can be shared by many
objects and passed between threads without synchronization.DefaultCoordinateSystemAxis,
AbstractCRS,
Serialized FormDefined in the sis-referencing module
DEPRECATED_KEY, LOCALE_KEYALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCS(CoordinateSystem cs)
Creates a new coordinate system with the same values than the specified one.
|
|
AbstractCS(Map<String,?> properties,
CoordinateSystemAxis... axes)
Constructs a coordinate system from a set of properties and a sequence of axes.
|
| Modifier and Type | Method and Description |
|---|---|
static AbstractCS |
castOrCopy(CoordinateSystem object)
Returns a SIS coordinate system implementation with the values of the given arbitrary implementation.
|
protected long |
computeHashCode()
Invoked by
hashCode() for computing the hash code when first needed. |
boolean |
equals(Object object,
ComparisonMode mode)
Compares the specified object with this coordinate system for equality.
|
AbstractCS |
forConvention(AxesConvention convention)
Returns a coordinate system equivalent to this one but with axes rearranged according the given convention.
|
protected String |
formatTo(Formatter formatter)
Formats the inner part of the Well Known Text (WKT) representation of this coordinate system.
|
CoordinateSystemAxis |
getAxis(int dimension)
Returns the axis for this coordinate system at the specified dimension.
|
int |
getDimension()
Returns the number of dimensions of this coordinate system.
|
Class<? extends CoordinateSystem> |
getInterface()
Returns the GeoAPI interface implemented by this class.
|
castOrCopy, equals, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForNameprint, toString, toString, toWKTclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAlias, getIdentifiers, getName, getRemarks, toWKTpublic AbstractCS(Map<String,?> properties, CoordinateSystemAxis... axes)
| Property name | Value type | Returned by |
|---|---|---|
| "name" | ReferenceIdentifier or String |
AbstractIdentifiedObject.getName() |
| "alias" | GenericName or CharSequence (optionally as array) |
AbstractIdentifiedObject.getAlias() |
| "identifiers" | ReferenceIdentifier (optionally as array) |
AbstractIdentifiedObject.getIdentifiers() |
| "remarks" | InternationalString or String |
AbstractIdentifiedObject.getRemarks() |
properties - the properties to be given to the identified object.axes - the sequence of axes.protected AbstractCS(CoordinateSystem cs)
This constructor performs a shallow copy, i.e. the properties are not cloned.
cs - the coordinate system to copy.castOrCopy(CoordinateSystem)public static AbstractCS castOrCopy(CoordinateSystem object)
null, then this method returns null.AffineCS,
CartesianCS,
SphericalCS,
EllipsoidalCS,
CylindricalCS,
PolarCS,
LinearCS,
VerticalCS,
TimeCS or
UserDefinedCS,
then this method delegates to the castOrCopy(…) method of the corresponding SIS subclass.
Note that if the given object implements more than one of the above-cited interfaces,
then the castOrCopy(…) method to be used is unspecified.AbstractCS, then it is returned unchanged.AbstractCS instance is created using the
copy constructor
and returned. Note that this is a shallow copy operation, since the other
properties contained in the given object are not recursively copied.object - the object to get as a SIS implementation, or null if none.null if the argument was null.public Class<? extends CoordinateSystem> getInterface()
CoordinateSystem.class.
Subclasses implementing a more specific GeoAPI interface shall override this method.getInterface in class AbstractIdentifiedObjectpublic final int getDimension()
getDimension in interface CoordinateSystempublic final CoordinateSystemAxis getAxis(int dimension) throws IndexOutOfBoundsException
getAxis in interface CoordinateSystemdimension - the zero based index of axis.IndexOutOfBoundsException - if dimension is out of bounds.public AbstractCS forConvention(AxesConvention convention)
this.convention - the axes convention for which a coordinate system is desired.this).AbstractCRS.forConvention(AxesConvention)public boolean equals(Object object, ComparisonMode mode)
equals in interface LenientComparableequals in class AbstractIdentifiedObjectobject - the object to compare to this.mode - STRICT for performing a strict comparison, or
IGNORE_METADATA for comparing only
properties relevant to coordinate transformations.true if both objects are equal.AbstractIdentifiedObject.computeHashCode(),
Utilities.deepEquals(Object, Object, ComparisonMode)protected long computeHashCode()
hashCode() for computing the hash code when first needed.
See AbstractIdentifiedObject.computeHashCode()
for more information.computeHashCode in class AbstractIdentifiedObjectprotected String formatTo(Formatter formatter)
CS[…] element for historical reasons. Axes shall be formatted by the enclosing
element (usually an AbstractCRS).
EllipsoidalCS
having (φ,λ) axes in a unit defined by the enclosing CRS (usually degrees).
CS[ellipsoidal, 2], Axis["latitude", north], Axis["longitude", east]
CS is defined in the WKT 2 specification only.formatTo in class AbstractIdentifiedObjectformatter - the formatter where to format the inner content of this WKT element."CS".Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.