|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.wkt.Formattable org.geotools.referencing.AbstractIdentifiedObject org.geotools.referencing.cs.AbstractCS
The set of coordinate system axes that spans a given coordinate space. A coordinate system (CS) is derived from a set of (mathematical) rules for specifying how coordinates in a given space are to be assigned to points. The coordinate values in a coordinate tuple shall be recorded in the order in which the coordinate system axes are recorded, whenever those coordinates use a coordinate reference system that uses this coordinate system.
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 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 is some cases (e.g. in a element). In such exceptional situation, a plain object may be instantiated.
DefaultCoordinateSystemAxis
,
Unit
,
AbstractDatum
,
AbstractCRS
,
Serialized FormField Summary |
Fields inherited from class org.geotools.referencing.AbstractIdentifiedObject |
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATOR |
Fields inherited from interface org.opengis.referencing.IdentifiedObject |
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY |
Constructor Summary | |
AbstractCS(org.opengis.referencing.cs.CoordinateSystem cs)
Constructs a new coordinate system with the same values than the specified one. |
|
AbstractCS(java.util.Map properties,
org.opengis.referencing.cs.CoordinateSystemAxis[] axis)
Constructs a coordinate system from a set of properties. |
|
AbstractCS(java.lang.String name,
org.opengis.referencing.cs.CoordinateSystemAxis[] axis)
Constructs a coordinate system from a name. |
Method Summary | |
Measure |
distance(double[] coord1,
double[] coord2)
Computes the distance between two points. |
boolean |
equals(AbstractIdentifiedObject object,
boolean compareMetadata)
Compares the specified object with this coordinate system for equality. |
protected java.lang.String |
formatWKT(Formatter formatter)
Format the inner part of a Well Known Text (WKT) element. |
org.opengis.referencing.cs.CoordinateSystemAxis |
getAxis(int dimension)
Returns the axis for this coordinate system at the specified dimension. |
int |
getDimension()
Returns the dimension of the coordinate system. |
int |
hashCode()
Returns a hash value for this coordinate system. |
protected boolean |
isCompatibleDirection(org.opengis.referencing.cs.AxisDirection direction)
Returns if the specified axis direction is allowed for this coordinate system. |
protected boolean |
isCompatibleUnit(org.opengis.referencing.cs.AxisDirection direction,
javax.units.Unit unit)
Returns is the specified unit is legal for the specified axis direction. |
static org.opengis.referencing.cs.CoordinateSystem |
standard(org.opengis.referencing.cs.CoordinateSystem cs)
Returns a coordinate system with "standard" axis order and units. |
static org.opengis.referencing.operation.Matrix |
swapAndScaleAxis(org.opengis.referencing.cs.CoordinateSystem sourceCS,
org.opengis.referencing.cs.CoordinateSystem targetCS)
Returns an affine transform between two coordinate systems. |
Methods inherited from class org.geotools.referencing.AbstractIdentifiedObject |
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches |
Methods inherited from class org.geotools.referencing.wkt.Formattable |
toString, toWKT, toWKT, toWKT |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.referencing.IdentifiedObject |
getAlias, getIdentifiers, getName, getRemarks, toWKT |
Constructor Detail |
public AbstractCS(org.opengis.referencing.cs.CoordinateSystem cs)
public AbstractCS(java.lang.String name, org.opengis.referencing.cs.CoordinateSystemAxis[] axis)
name
- The coordinate system name.axis
- The set of axis.public AbstractCS(java.util.Map properties, org.opengis.referencing.cs.CoordinateSystemAxis[] axis)
properties
- Set of properties. Should contains at least "name"
.axis
- The set of axis.Method Detail |
protected boolean isCompatibleDirection(org.opengis.referencing.cs.AxisDirection direction)
protected boolean isCompatibleUnit(org.opengis.referencing.cs.AxisDirection direction, javax.units.Unit unit)
public int getDimension()
getDimension
in interface org.opengis.referencing.cs.CoordinateSystem
public org.opengis.referencing.cs.CoordinateSystemAxis getAxis(int dimension) throws java.lang.IndexOutOfBoundsException
getAxis
in interface org.opengis.referencing.cs.CoordinateSystem
dimension
- The zero based index of axis.
java.lang.IndexOutOfBoundsException
- if is out of bounds.public static org.opengis.referencing.operation.Matrix swapAndScaleAxis(org.opengis.referencing.cs.CoordinateSystem sourceCS, org.opengis.referencing.cs.CoordinateSystem targetCS) throws java.lang.IllegalArgumentException, javax.units.ConversionException
Example: If coordinates in are (x,y) pairs in metres and coordinates in are (-y,x) pairs in centimetres, then the transformation can be performed as below:
[-y(cm)] [ 0 -100 0 ] [x(m)] [ x(cm)] = [ 100 0 0 ] [y(m)] [ 1 ] [ 0 0 1 ] [1 ]
sourceCS
- The source coordinate system.targetCS
- The target coordinate system.
java.lang.IllegalArgumentException
- if axis doesn't matches, or the CS doesn't have the
same geometry.
javax.units.ConversionException
- if the unit conversion is non-linear.public static org.opengis.referencing.cs.CoordinateSystem standard(org.opengis.referencing.cs.CoordinateSystem cs) throws java.lang.IllegalArgumentException
swapAndScaleAxis
for the creation of a
transformation step before some math transform. Example:
Matrix step1 = swapAndScaleAxis(sourceCS, standard(sourceCS)); Matrix step2 = ... some transform operating on standard axis ... Matrix step3 = swapAndScaleAxis(standard(targetCS), targetCS);
A rational for standard axis order and units is explained in the Axis units and direction section in the description of map projection package.
cs
- The coordinate system.
java.lang.IllegalArgumentException
- if the specified coordinate system is unknow to this method.public Measure distance(double[] coord1, double[] coord2) throws java.lang.UnsupportedOperationException, org.opengis.spatialschema.geometry.MismatchedDimensionException
coord1
- Coordinates of the first point.coord2
- Coordinates of the second point.
java.lang.UnsupportedOperationException
- if this coordinate system can't compute distances.
org.opengis.spatialschema.geometry.MismatchedDimensionException
- if a coordinate doesn't have the expected dimension.public boolean equals(AbstractIdentifiedObject object, boolean compareMetadata)
equals
in class AbstractIdentifiedObject
object
- The object to compare to .compareMetadata
- for performing a strict comparaison, or
for comparing only properties relevant to transformations.
public int hashCode()
hashCode
in class AbstractIdentifiedObject
protected java.lang.String formatWKT(Formatter formatter)
formatWKT
in class Formattable
formatter
- The formatter to use.
Formattable.toWKT()
,
Formattable.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |