DefaultCoordinateSystemAxis (Apache SIS 1.6 API) JavaScript is disabled on your browser.     Skip navigation links Overview Class Use Tree New Deprecated Index Search Help org.apache.sis.referencing org.apache.sis.referencing.cs DefaultCoordinateSystemAxis Contents  Description Axis names Immutability and thread safety Field Summary Constructor Summary Method Summary Field Details MINIMUM_VALUE_KEY MAXIMUM_VALUE_KEY RANGE_MEANING_KEY Constructor Details DefaultCoordinateSystemAxis(Map, String, AxisDirection, Unit) DefaultCoordinateSystemAxis(CoordinateSystemAxis) Method Details castOrCopy(CoordinateSystemAxis) getInterface() getDirection() getAbbreviation() getUnit() getMinimumValue() getMaximumValue() getRangeMeaning() isHeuristicMatchForName(String) equals(Object, ComparisonMode) formatTo(Formatter) Hide sidebar  Show sidebar Class DefaultCoordinateSystemAxis Object FormattableObject AbstractIdentifiedObject DefaultCoordinateSystemAxis All Implemented Interfaces: Serializable, Formattable, Deprecable, Lenient­Comparable, Printable, Coordinate­System­Axis, Identified­Object public class DefaultCoordinateSystemAxis extends AbstractIdentifiedObject implements CoordinateSystemAxis Coordinate system axis name, direction, unit and range of values. Axis names In some case, the axis name is constrained by ISO 19111 depending on the coordinate reference system type. 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­CRS. Conversely, these names shall not be used in any other context. See the GeoAPI Coordinate­System­Axis javadoc for more information. Immutability and thread safety This class is immutable and thus thread-safe if the property values (not necessarily the map itself) given to the constructor are also immutable. Unless otherwise noted in the javadoc, this condition holds if all components were created using only SIS factories and static constants. Since: 0.4 See Also: Abstract­CS Unit Serialized Form Field Summary Fields Modifier and Type Field Description static final String MAXIMUM_VALUE_KEY Key for the "maximum­Value" property to be given to the constructor. static final String MINIMUM_VALUE_KEY Key for the "minimum­Value" property to be given to the constructor. static final String RANGE_MEANING_KEY Key for the "range­Meaning" property to be given to the constructor. Fields inherited from class AbstractIdentifiedObject DEPRECATED_KEY, DOMAINS_KEY, LOCALE_KEY Fields inherited from interface IdentifiedObject ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY Constructor Summary Constructors Modifier Constructor Description   Default­Coordinate­System­Axis(Map<String,?> properties, String abbreviation, Axis­Direction direction, Unit<?> unit) Constructs an axis from a set of properties. protected Default­Coordinate­System­Axis(Coordinate­System­Axis axis) Creates a new coordinate system axis with the same values as the specified one. Method Summary All MethodsStatic MethodsInstance MethodsConcrete Methods Modifier and Type Method Description static Default­Coordinate­System­Axis cast­Or­Copy(Coordinate­System­Axis object) Returns a SIS axis implementation with the same values as the given arbitrary implementation. boolean equals(Object object, Comparison­Mode mode) Compares the specified object with this axis for equality. protected String format­To(Formatter formatter) Formats this axis as a Well Known Text Axis[…] element. String get­Abbreviation() Returns the abbreviation used for this coordinate system axes. Axis­Direction get­Direction() Returns the direction of this coordinate system axis. Class<? extends Coordinate­System­Axis> get­Interface() Returns the GeoAPI interface implemented by this class. double get­Maximum­Value() Returns the maximum value normally allowed for this axis, in the unit of measure for the axis. double get­Minimum­Value() Returns the minimum value normally allowed for this axis, in the unit of measure for the axis. Range­Meaning get­Range­Meaning() Returns the meaning of axis value range specified by the minimum and maximum values. Unit<?> get­Unit() Returns the unit of measure used for this coordinate system axis. boolean is­Heuristic­Match­For­Name(String name) Returns true if either the primary name or at least one alias matches the given string according heuristic rules. Methods inherited from class AbstractIdentifiedObject cast­Or­Copy, equals, format­To, get­Alias, get­Description, get­Domains, get­Identifiers, get­Name, get­Remarks, hash­Code, is­Deprecated Methods inherited from class FormattableObject print, to­String, to­String, to­WKT Methods inherited from class Object clone, finalize, get­Class, notify, notify­All, wait, wait, wait Methods inherited from interface IdentifiedObject get­Alias, get­Identifiers, get­Name, get­Remarks, to­WKT Field Details MINIMUM_VALUE_KEY public static final String MINIMUM_VALUE_KEY Key for the "minimum­Value" property to be given to the constructor. This is used for setting the value to be returned by get­Minimum­Value(). See Also: Constant Field Values MAXIMUM_VALUE_KEY public static final String MAXIMUM_VALUE_KEY Key for the "maximum­Value" property to be given to the constructor. This is used for setting the value to be returned by get­Maximum­Value(). See Also: Constant Field Values RANGE_MEANING_KEY public static final String RANGE_MEANING_KEY Key for the "range­Meaning" property to be given to the constructor. This is used for setting the value to be returned by get­Range­Meaning(). See Also: Constant Field Values Constructor Details DefaultCoordinateSystemAxis public DefaultCoordinateSystemAxis(Map<String,?> properties, String abbreviation, AxisDirection direction, Unit<?> unit) Constructs an axis from a set of properties. The properties given in argument follow the same rules than for the super-class constructor. Additionally, the following properties are understood by this constructor: Recognized properties (non exhaustive list) Property name Value type Returned by "minimumValue" Number getMinimumValue() "maximumValue" Number getMaximumValue() "rangeMeaning" RangeMeaning getRangeMeaning() Defined in parent class (reminder) "name" ReferenceIdentifier or String AbstractIdentifiedObject.getName() "alias" GenericName or Char­Sequence (optionally as array) AbstractIdentifiedObject.getAlias() "identifiers" ReferenceIdentifier (optionally as array) AbstractIdentifiedObject.getIdentifiers() "remarks" InternationalString or String AbstractIdentifiedObject.getRemarks() Generally speaking, information provided in the properties map are considered ignorable metadata (except the axis name) while information provided as explicit arguments may have an impact on coordinate transformation results. Exceptions to this rule are the minimum­Value and maximum­Value in the particular case where range­Meaning is Range­Meaning​.WRAPAROUND. If no minimum, maximum and range meaning are specified, then this constructor will infer them from the axis unit and direction. Parameters: properties - the properties to be given to the identified object. 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. See Also: Geodetic­Object­Factory​.create­Coordinate­System­Axis(Map, String, Axis­Direction, Unit) DefaultCoordinateSystemAxis protected DefaultCoordinateSystemAxis(CoordinateSystemAxis axis) Creates a new coordinate system axis with the same values as the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS 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. See Also: cast­Or­Copy(Coordinate­System­Axis) Method Details castOrCopy public static DefaultCoordinateSystemAxis castOrCopy(CoordinateSystemAxis object) Returns a SIS axis implementation with the same values as the given arbitrary implementation. If the given object is null, then this method returns null. Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged. Otherwise a new SIS implementation is created and initialized to the values of the given object. Parameters: object - the object to get as a SIS implementation, or null if none. Returns: a SIS implementation containing the values of the given object (may be the given object itself), or null if the argument was null. getInterface public Class<? extends CoordinateSystemAxis> getInterface() Returns the GeoAPI interface implemented by this class. The SIS implementation returns Coordinate­System­Axis​.class. Note for implementers Subclasses usually do not need to override this method since GeoAPI does not define Coordinate­System­Axis sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces. Overrides: get­Interface in class Abstract­Identified­Object Returns: Coordinate­System­Axis​.class or a user-defined sub-interface. getDirection public AxisDirection getDirection() Returns the direction of this coordinate system axis. This direction is often approximate and intended to provide a human interpretable meaning to the axis. A coordinate system cannot contain two axes having the same direction or opposite directions. Examples: north or south, east or west, up or down. Specified by: get­Direction in interface Coordinate­System­Axis Returns: the direction of this coordinate system axis. getAbbreviation public String getAbbreviation() Returns the abbreviation used for this coordinate system axes. Examples are X and Y. Specified by: get­Abbreviation in interface Coordinate­System­Axis Returns: the coordinate system axis abbreviation. getUnit public Unit<?> getUnit() Returns the unit of measure used for this coordinate system axis. If this Coordinate­System­Axis was given by Coordinate­System​.get­Axis(i), then all coordinate values at dimension i in a coordinate tuple shall be recorded using this unit of measure. Specified by: get­Unit in interface Coordinate­System­Axis Returns: the unit of measure used for coordinate values along this coordinate system axis. 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: get­Minimum­Value in interface Coordinate­System­Axis Returns: the minimum value normally allowed for this axis. 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: get­Maximum­Value in interface Coordinate­System­Axis Returns: the maximum value normally allowed for this axis. getRangeMeaning public RangeMeaning getRangeMeaning() Returns the meaning of axis value range specified by the minimum and maximum values. If there is no minimum and maximum values (i.e. if those values are negative infinity and positive infinity respectively), then this method returns null. Specified by: get­Range­Meaning in interface Coordinate­System­Axis Returns: the meaning of axis value range, or null if unspecified. isHeuristicMatchForName public boolean isHeuristicMatchForName(String name) Returns true if either the primary name or at least one alias matches the given string according heuristic rules. This method performs the comparison documented in the super-class, with an additional flexibility 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 states explicitly that the latitude and longitude axis names shall be Geodetic latitude and Geodetic longitude, while the legacy OGC 01-009 (where version 1 of the WKT format is defined) said that the default values shall be Lat and Lon. Future evolutions This method implements heuristic rules learned from experience while trying to provide inter-operability with different data producers. Those rules may be adjusted in any future SIS version according experience gained while working with more data producers. Overrides: is­Heuristic­Match­For­Name in class Abstract­Identified­Object Parameters: name - the name to compare. Returns: true if the primary name of at least one alias matches the specified name. See Also: Identified­Objects​.is­Heuristic­Match­For­Name(Identified­Object, String) Characters​.Filter​.LETTERS_AND_DIGITS equals public boolean equals(Object object, ComparisonMode mode) Compares the specified object with this axis for equality. The strictness level is controlled by the second argument. This method compares the following properties in every cases: Abstract­Identified­Object​.get­Name() get­Direction() get­Unit() In the particular case where get­Range­Meaning() is WRAPAROUND, then get­Minimum­Value() and get­Maximum­Value() are considered non-ignorable metadata and will be compared for every modes. All other properties are compared only for modes stricter than Comparison­Mode​.IGNORE_METADATA. Specified by: equals in interface Lenient­Comparable Overrides: equals in class Abstract­Identified­Object Parameters: object - the object to compare to this. mode - the strictness level of the comparison. Returns: true if both objects are equal. See Also: Abstract­Identified­Object​.compute­Hash­Code() Utilities​.deep­Equals(Object, Object, Comparison­Mode) formatTo protected String formatTo(Formatter formatter) Formats this axis as a Well Known Text Axis[…] element. Constraints for WKT validity The ISO 19162 specification puts many constraints on axis names, abbreviations and directions allowed in WKT. Most of those constraints are inherited from ISO 19111 — see Coordinate­System­Axis javadoc for some of those. The current Apache SIS implementation does not verify whether this axis name and abbreviation are compliant; we assume that the user created a valid axis. The only actions (derived from ISO 19162 rules) taken by this method (by default) are: Replace Geodetic latitude and Geodetic longitude names (case insensitive) by latitude and longitude respectively. For latitude and longitude axes, replace “φ” and “λ” abbreviations by “B” and “L” respectively (from German “Breite” and “Länge”, used in academic texts worldwide). Note that “L” is also the transliteration of Greek letter “lambda” (λ). In Spherical­CS, replace “φ” and “θ” abbreviations by “U” and “V” respectively. In Polar­CS, replace “θ” abbreviation by “U”. The above-cited replacements of name and Greek letters can be controlled by a call to WKTFormat​.set­Transliterator(Transliterator). Overrides: format­To in class Abstract­Identified­Object Parameters: formatter - the formatter where to format the inner content of this WKT element. Returns: "Axis". See Also: Formattable­Object​.to­WKT() Formattable­Object​.to­String()