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
LOCALE_KEY
ALIAS_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 this Well Known Text (WKT) CS into the given formatter.
|
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, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
print, toString, toString, toWKT
getAlias, getIdentifiers, getName, getRemarks, toWKT
public 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 AbstractIdentifiedObject
public final int getDimension()
getDimension
in interface CoordinateSystem
public final CoordinateSystemAxis getAxis(int dimension) throws IndexOutOfBoundsException
getAxis
in interface CoordinateSystem
dimension
- 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 LenientComparable
equals
in class AbstractIdentifiedObject
object
- 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 AbstractIdentifiedObject
protected 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 AbstractIdentifiedObject
formatter
- The formatter where to format the inner content of this WKT element."CS"
.FormattableObject.toWKT()
,
FormattableObject.toString()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.