Class DefaultCoordinateSystemAxis
- All Implemented Interfaces:
Serializable,CoordinateSystemAxis,IdentifiedObject
In some case, the axis name is constrained by ISO 19111 depending on the coordinate reference system type. These constraints are identified in the javadoc by "ISO 19111 name is..." sentences. This constraint works in two directions; for example the names "geodetic latitude" and "geodetic longitude" shall be used to designate the coordinate axis names associated with a geographic coordinate reference system. Conversely, these names shall not be used in any other context.
- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DefaultCoordinateSystemAxisThe default axis for altitude values.static final DefaultCoordinateSystemAxisA default axis for column indices in a grid coverage.static final DefaultCoordinateSystemAxisThe default axis for depth.static final DefaultCoordinateSystemAxisA default axis for x values in a display device.static final DefaultCoordinateSystemAxisA default axis for y values in a display device.static final DefaultCoordinateSystemAxisDefault axis info for Easting values in a projected CRS.static final DefaultCoordinateSystemAxisThe default axis for height values above the ellipsoid in a geographic CRS.static final DefaultCoordinateSystemAxisDefault axis info for radius in a geocentric CRS using spherical CS.static final DefaultCoordinateSystemAxisDefault axis info for x values in a geocentric CRS using cartesian CS.static final DefaultCoordinateSystemAxisDefault axis info for y values in a geocentric CRS using cartesian CS.static final DefaultCoordinateSystemAxisDefault axis info for z values in a geocentric CRS using cartesian CS.static final DefaultCoordinateSystemAxisDefault axis info for geodetic latitudes in a geographic CRS.static final DefaultCoordinateSystemAxisDefault axis info for geodetic longitudes in a geographic CRS.static final DefaultCoordinateSystemAxisThe default axis for height values measured from gravity.static final DefaultCoordinateSystemAxisDefault axis info for latitudes.static final DefaultCoordinateSystemAxisDefault axis info for longitudes.static final DefaultCoordinateSystemAxisDefault axis info for Northing values in a projected CRS.static final DefaultCoordinateSystemAxisA default axis for row indices in a grid coverage.static final DefaultCoordinateSystemAxisDefault axis info for Southing values in a projected CRS.static final DefaultCoordinateSystemAxisDefault axis info for latitudes in a geocentric CRS using spherical CS.static final DefaultCoordinateSystemAxisDefault axis info for longitudes in a geocentric CRS using spherical CS.static final DefaultCoordinateSystemAxisA default axis for time values in a time CS.static final DefaultCoordinateSystemAxisDefault axis info for Westing values in a projected CRS.static final DefaultCoordinateSystemAxisDefault axis info for x values in a cartesian CS.static final DefaultCoordinateSystemAxisDefault axis info for y values in a cartesian CS.static final DefaultCoordinateSystemAxisDefault axis info for z values in a cartesian CS.Fields inherited from class AbstractIdentifiedObject
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATORFields inherited from class Formattable
SINGLE_LINEFields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCoordinateSystemAxis(String abbreviation, AxisDirection direction, Unit<?> unit) Constructs an axis with the same name as the abbreviation.DefaultCoordinateSystemAxis(Map<String, ?> properties, String abbreviation, AxisDirection direction, Unit<?> unit) Constructs an unbounded axis from a set of properties.DefaultCoordinateSystemAxis(Map<String, ?> properties, String abbreviation, AxisDirection direction, Unit<?> unit, double minimum, double maximum, RangeMeaning rangeMeaning) Constructs an axis from a set of properties.Constructs a new coordinate system axis with the same values than the specified one.DefaultCoordinateSystemAxis(InternationalString name, String abbreviation, AxisDirection direction, Unit<?> unit) Constructs an axis with a name as an international string and an abbreviation. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(AbstractIdentifiedObject object, boolean compareMetadata) Compares the specified object with this axis for equality.protected StringFormat the inner part of a Well Known Text (WKT) element.The abbreviation used for this coordinate system axes.static doublegetAngle(AxisDirection source, AxisDirection target) Returns the arithmetic (counterclockwise) angle from the first direction to the second direction, in decimal degrees.Direction of this coordinate system axis.static AxisDirectiongetDirection(String direction) Returns an axis direction constants from its name.doubleReturns the maximum value normally allowed for this axis, in the unit of measure for the axis.doubleReturns the minimum value normally allowed for this axis, in the unit of measure for the axis.static DefaultCoordinateSystemAxisgetPredefined(String name, AxisDirection direction) Returns one of the predefined axis for the given name and direction, ornullif none.Unit<?>getUnit()The unit of measure used for this coordinate system axis.inthashCode()Returns a hash value for this axis.static booleanisCompassDirection(AxisDirection direction) Returnstrueif the specified direction is a compass direction.booleannameMatches(String name) static booleanperpendicular(AxisDirection first, AxisDirection second) Returnstrueif the specified directions are perpendicular.Methods inherited from class AbstractIdentifiedObject
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatchesMethods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKTMethods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
GEODETIC_LONGITUDE
Default axis info for geodetic longitudes in a geographic CRS.Increasing ordinates values go East and units are decimal degrees.
The ISO 19111 name is "geodetic longitude" and the abbreviation is "λ" (lambda).
This axis is usually part of a
GEODETIC_LONGITUDE,GEODETIC_LATITUDE,ELLIPSOIDAL_HEIGHTset.- See Also:
-
GEODETIC_LATITUDE
Default axis info for geodetic latitudes in a geographic CRS.Increasing ordinates values go North and units are decimal degrees.
The ISO 19111 name is "geodetic latitude" and the abbreviation is "φ" (phi).
This axis is usually part of a
GEODETIC_LONGITUDE,GEODETIC_LATITUDE,ELLIPSOIDAL_HEIGHTset.- See Also:
-
LONGITUDE
Default axis info for longitudes.Increasing ordinates values go East and units are decimal degrees.
The abbreviation is "λ" (lambda).
This axis is usually part of a
LONGITUDE,LATITUDE,ALTITUDEset.- See Also:
-
LATITUDE
Default axis info for latitudes.Increasing ordinates values go North and units are decimal degrees.
The abbreviation is "φ" (phi).
This axis is usually part of a
LONGITUDE,LATITUDE,ALTITUDEset.- See Also:
-
ELLIPSOIDAL_HEIGHT
The default axis for height values above the ellipsoid in a geographic CRS.Increasing ordinates values go up and units are metres.
The ISO 19111 name is "ellipsoidal heigt" and the abbreviation is lower case "h".
This axis is usually part of a
GEODETIC_LONGITUDE,GEODETIC_LATITUDE,ELLIPSOIDAL_HEIGHTset.- See Also:
-
GRAVITY_RELATED_HEIGHT
The default axis for height values measured from gravity.Increasing ordinates values go up and units are metres.
The ISO 19111 name is "gravity-related height" and the abbreviation is lower case "H".
- See Also:
-
ALTITUDE
-
DEPTH
The default axis for depth.Increasing ordinates values go down and units are metres.
The ISO 19111 name is "depth".
-
GEOCENTRIC_RADIUS
Default axis info for radius in a geocentric CRS using spherical CS.Increasing ordinates values go up and units are metres.
The ISO 19111 name is "geocentric radius" and the abbreviation is lower case "r".
This axis is usually part of a
SPHERICAL_LONGITUDE,SPHERICAL_LATITUDE,GEOCENTRIC_RADIUSset. -
SPHERICAL_LONGITUDE
Default axis info for longitudes in a geocentric CRS using spherical CS.Increasing ordinates values go East and units are decimal degrees.
The ISO 19111 name is "spherical longitude" and the abbreviation is "Ω" (omega).
This axis is usually part of a
SPHERICAL_LONGITUDE,SPHERICAL_LATITUDE,GEOCENTRIC_RADIUSset.- See Also:
-
SPHERICAL_LATITUDE
Default axis info for latitudes in a geocentric CRS using spherical CS.Increasing ordinates values go North and units are decimal degrees.
The ISO 19111 name is "spherical latitude" and the abbreviation is "Θ" (theta).
This axis is usually part of a
SPHERICAL_LONGITUDE,SPHERICAL_LATITUDE,GEOCENTRIC_RADIUSset.- See Also:
-
X
Default axis info for x values in a cartesian CS.Increasing ordinates values go East and units are metres.
The abbreviation is lower case "x".
- See Also:
-
Y
Default axis info for y values in a cartesian CS.Increasing ordinates values go North and units are metres.
The abbreviation is lower case "y".
- See Also:
-
Z
Default axis info for z values in a cartesian CS.Increasing ordinates values go up and units are metres.
The abbreviation is lower case "z".
-
GEOCENTRIC_X
Default axis info for x values in a geocentric CRS using cartesian CS.Increasing ordinates values go toward prime meridian and units are metres.
The ISO 19111 name is "geocentric X" and the abbreviation is upper case "X".
This axis is usually part of a
GEOCENTRIC_X,GEOCENTRIC_Y,GEOCENTRIC_Zset. -
GEOCENTRIC_Y
Default axis info for y values in a geocentric CRS using cartesian CS.Increasing ordinates values go East and units are metres.
The ISO 19111 name is "geocentric Y" and the abbreviation is upper case "Y".
This axis is usually part of a
GEOCENTRIC_X,GEOCENTRIC_Y,GEOCENTRIC_Zset. -
GEOCENTRIC_Z
Default axis info for z values in a geocentric CRS using cartesian CS.Increasing ordinates values go North and units are metres.
The ISO 19111 name is "geocentric Z" and the abbreviation is upper case "Z".
This axis is usually part of a
GEOCENTRIC_X,GEOCENTRIC_Y,GEOCENTRIC_Zset. -
EASTING
Default axis info for Easting values in a projected CRS.Increasing ordinates values go East and units are metres.
The ISO 19111 name is "easting" and the abbreviation is upper case "E".
-
WESTING
Default axis info for Westing values in a projected CRS.Increasing ordinates values go West and units are metres.
The ISO 19111 name is "westing" and the abbreviation is upper case "W".
-
NORTHING
Default axis info for Northing values in a projected CRS.Increasing ordinates values go North and units are metres.
The ISO 19111 name is "northing" and the abbreviation is upper case "N".
-
SOUTHING
Default axis info for Southing values in a projected CRS.Increasing ordinates values go South and units are metres.
The ISO 19111 name is "southing" and the abbreviation is upper case "S".
-
TIME
-
COLUMN
A default axis for column indices in a grid coverage. Increasing values go toward positive column number.The abbreviation is lower case "i".
-
ROW
A default axis for row indices in a grid coverage. Increasing values go toward positive row number.The abbreviation is lower case "j".
-
DISPLAY_X
A default axis for x values in a display device. Increasing values go toward display right.The abbreviation is lower case "x".
- Since:
- 2.2
-
DISPLAY_Y
A default axis for y values in a display device. Increasing values go toward display down.The abbreviation is lower case "y".
- Since:
- 2.2
-
-
Constructor Details
-
DefaultCoordinateSystemAxis
Constructs a new coordinate system axis with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotools one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. This constructor performs a shallow copy, i.e. the properties are not cloned.- Parameters:
axis- The coordinate system axis to copy.- Since:
- 2.2
-
DefaultCoordinateSystemAxis
public DefaultCoordinateSystemAxis(Map<String, ?> properties, String abbreviation, AxisDirection direction, Unit<?> unit, double minimum, double maximum, RangeMeaning rangeMeaning) Constructs an axis from a set of properties. The properties map is given unchanged to the super-class constructor.- Parameters:
properties- Set of properties. Should contains at least"name".abbreviation- The abbreviation used for this coordinate system axes.direction- The direction of this coordinate system axis.unit- The unit of measure used for this coordinate system axis.minimum- The minimum value normally allowed for this axis.maximum- The maximum value normally allowed for this axis.rangeMeaning- The meaning of axis value range specified by the minimum and maximum values.- Since:
- 2.3
-
DefaultCoordinateSystemAxis
public DefaultCoordinateSystemAxis(Map<String, ?> properties, String abbreviation, AxisDirection direction, Unit<?> unit) Constructs an unbounded axis from a set of properties. The properties map is given unchanged to the super-class constructor. The minimum and maximum values are inferred from the axis unit and direction.- Parameters:
properties- Set of properties. Should contains at least"name".abbreviation- The abbreviation used for this coordinate system axes.direction- The direction of this coordinate system axis.unit- The unit of measure used for this coordinate system axis.
-
DefaultCoordinateSystemAxis
Constructs an axis with the same name as the abbreviation.- Parameters:
abbreviation- The abbreviation used for this coordinate system axes.direction- The direction of this coordinate system axis.unit- The unit of measure used for this coordinate system axis.
-
DefaultCoordinateSystemAxis
public DefaultCoordinateSystemAxis(InternationalString name, String abbreviation, AxisDirection direction, Unit<?> unit) Constructs an axis with a name as an international string and an abbreviation. The name of this identified object is set to the unlocalized version of thenameargument, as given byname.toString(null). The samenameargument is also stored as an alias, which allows fetching localized versions of the name.- Parameters:
name- The name of this axis. Also stored as an alias for localization purpose.abbreviation- The abbreviation used for this coordinate system axis.direction- The direction of this coordinate system axis.unit- The unit of measure used for this coordinate system axis.
-
-
Method Details
-
getPredefined
Returns one of the predefined axis for the given name and direction, ornullif none. This method searchs only in predefined constants likeGEODETIC_LATITUDE, not in any custom axis instantiated by a public constructor. The name of those constants match ISO 19111 names or some names commonly found in Well Known Text (WKT) formats.This method first checks if the specified name matches the abbreviation of a predefined axis. The comparaison is case-sensitive (for example the
GEOCENTRIC_Xabbreviation is uppercase"X", while the abbreviation for the genericXaxis is lowercase"x").If the specified name doesn't match any abbreviation, then this method compares the name against predefined axis name in a case-insensitive manner. Examples of valid names are "Geodetic latitude" and "Northing".
The direction argument is optional and can be used in order to resolve ambiguity like
XandDISPLAY_Xaxis. If this argument isnull, then the first axis with a matching name or abbreviation will be returned.- Parameters:
name- The axis name or abbreviation.direction- An optional direction, ornull.- Returns:
- One of the constants declared in this class, or
null. - Since:
- 2.4
-
getDirection
Returns an axis direction constants from its name.- Parameters:
direction- The direction name (e.g. "north", "east", etc.).- Returns:
- The axis direction for the given name.
- Throws:
NoSuchElementException- if the given name is not a know axis direction.
-
getDirection
Direction of this coordinate system axis. In the case of Cartesian projected coordinates, this is the direction of this coordinate system axis locally. Examples: north or south, east or west, up or down.Within any set of coordinate system axes, only one of each pair of terms can be used. For earth-fixed coordinate reference systems, this direction is often approximate and intended to provide a human interpretable meaning to the axis. When a geodetic datum is used, the precise directions of the axes may therefore vary slightly from this approximate direction.
Note that an
DefaultEngineeringCRSoften requires specific descriptions of the directions of its coordinate system axes.- Specified by:
getDirectionin interfaceCoordinateSystemAxis- Returns:
- The coordinate system axis direction.
-
getAbbreviation
The abbreviation used for this coordinate system axes. This abbreviation is also used to identify the ordinates in coordinate tuple. Examples are "X" and "Y".- Specified by:
getAbbreviationin interfaceCoordinateSystemAxis- Returns:
- The coordinate system axis abbreviation.
-
getUnit
public Unit<?> getUnit()The unit of measure used for this coordinate system axis. The value of this coordinate in a coordinate tuple shall be recorded using this unit of measure, whenever those coordinates use a coordinate reference system that uses a coordinate system that uses this axis.- Specified by:
getUnitin interfaceCoordinateSystemAxis- Returns:
- The coordinate system axis unit.
-
getMinimumValue
public double getMinimumValue()Returns the minimum value normally allowed for this axis, in the unit of measure for the axis. If there is no minimum value, then this method returns negative infinity.- Specified by:
getMinimumValuein interfaceCoordinateSystemAxis- Returns:
- The minimum value, or
Double.NEGATIVE_INFINITYif none. - Since:
- 2.3
-
getMaximumValue
public double getMaximumValue()Returns the maximum value normally allowed for this axis, in the unit of measure for the axis. If there is no maximum value, then this method returns negative infinity.- Specified by:
getMaximumValuein interfaceCoordinateSystemAxis- Returns:
- The maximum value, or
Double.POSITIVE_INFINITYif none. - Since:
- 2.3
-
getRangeMeaning
Returns the meaning of axis value range specified by the minimum and maximum values. This element shall be omitted when both minimum and maximum values are omitted. It may be included when minimum and/or maximum values are included. If this element is omitted when minimum or maximum values are included, the meaning is unspecified.- Specified by:
getRangeMeaningin interfaceCoordinateSystemAxis- Returns:
- The range meaning, or
nullin none. - Since:
- 2.3
-
isCompassDirection
Returnstrueif the specified direction is a compass direction. Compass directions include "North", "North-North-East", "North-East", etc.- Parameters:
direction- The axis direction to test.- Returns:
trueif the given direction is a compass direction.- Since:
- 2.4
-
getAngle
Returns the arithmetic (counterclockwise) angle from the first direction to the second direction, in decimal degrees. This method returns a value between -180° and +180°, orNaNif no angle can be computed.A positive angle denotes a right-handed system, while a negative angle denotes a left-handed system. Example:
- Parameters:
source- The source axis direction.target- The target axis direction.- Returns:
- The arithmetic angle (in degrees) of the rotation to apply on a line pointing toward the source direction
in order to make it point toward the target direction, or
Double.NaNif this value can't be computed. - Since:
- 2.4
-
perpendicular
Returnstrueif the specified directions are perpendicular.- Parameters:
first- The first axis direction to test.second- The second axis direction to test.- Returns:
trueif the given axis direction are perpendicular.- Since:
- 2.4
-
nameMatches
Returnstrueif either the primary name or at least one alias matches the specified string. This method performs all the searh done by the super-class, with the addition of special processing for latitudes and longitudes:"Lat","Latitude"and"Geodetic latitude"are considered equivalent."Lon","Longitude"and"Geodetic longitude"are considered equivalent.
The above special cases are needed in order to workaround a conflict in specifications: ISO 19111 explicitly state that the latitude and longitude axis names shall be "Geodetic latitude" and "Geodetic longitude", will legacy OGC 01-009 (where WKT is defined) said that the default values shall be "Lat" and "Lon".
- Overrides:
nameMatchesin classAbstractIdentifiedObject- Parameters:
name- The name to compare.- Returns:
trueif the primary name of at least one alias matches the specifiedname.
-
equals
Compares the specified object with this axis for equality.- Overrides:
equalsin classAbstractIdentifiedObject- Parameters:
object- The object to compare tothis.compareMetadata-truefor performing a strict comparaison, orfalsefor comparing only properties relevant to transformations.- Returns:
trueif both objects are equal.
-
hashCode
public int hashCode()Returns a hash value for this axis. This value doesn't need to be the same in past or future versions of this class.- Overrides:
hashCodein classAbstractIdentifiedObject- Returns:
- The hash code value. This value doesn't need to be the same in past or future versions of this class.
-
formatWKT
Format the inner part of a Well Known Text (WKT) element. WKT is returned by thetoStringmethod and looks likeAXIS["name",NORTH].- Overrides:
formatWKTin classFormattable- Parameters:
formatter- The formatter to use.- Returns:
- The WKT element name, which is "AXIS".
- See Also:
-