Package org.geotools.referencing.cs
Class DirectionAlongMeridian
Object
DirectionAlongMeridian
- All Implemented Interfaces:
Serializable
,Comparable<DirectionAlongMeridian>
public final class DirectionAlongMeridian
extends Object
implements Comparable<DirectionAlongMeridian>, Serializable
Parses axis direction of the kind "South along 90 deg East". Those directions
are used in the EPSG database for polar stereographic projections.
- Since:
- 2.7.2
- Author:
- Martin Desruisseaux
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AxisDirection
The base direction, which must beAxisDirection.NORTH
orAxisDirection.SOUTH
.final double
The meridian, in degrees. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares this direction with the specified one for order.boolean
Tests this object for equality with the specified one.double
getAngle
(DirectionAlongMeridian other) Returns the arithmetic (counterclockwise) angle from this direction to the specified direction, in decimal degrees.Returns the axis direction for this object.int
hashCode()
Returns a hash code value, for consistency withequals(java.lang.Object)
.static DirectionAlongMeridian
If the specified name is a direction along some specific meridian, returns information about that.static DirectionAlongMeridian
parse
(AxisDirection direction) Returns the dimension along meridian for the specified axis direction, ornull
if none.toString()
Returns a string representation of this direction, using a syntax matching the one used by EPSG.
-
Field Details
-
baseDirection
The base direction, which must beAxisDirection.NORTH
orAxisDirection.SOUTH
. -
meridian
public final double meridianThe meridian, in degrees.
-
-
Method Details
-
parse
Returns the dimension along meridian for the specified axis direction, ornull
if none. -
parse
If the specified name is a direction along some specific meridian, returns information about that. Otherwise returnsnull
. -
getDirection
Returns the axis direction for this object. If a suitable axis direction already exists, it will be returned. Otherwise a new one is created and returned. -
getAngle
Returns the arithmetic (counterclockwise) angle from this direction to the specified direction, in decimal degrees. This method returns a value between -180° and +180°, orNaN
if the base directions don't match. A positive angle denote a right-handed system.Example: the angle from "North along 90 deg East" to "North along 0 deg is 90°.
-
compareTo
Compares this direction with the specified one for order. This method tries to reproduce the ordering used for the majority of coordinate systems in the EPSG database, i.e. the ordering of a right-handed coordinate system. Examples of ordered pairs that we should get (extracted from the EPSG database):North along 90 deg East, North along 0 deg North along 75 deg West, North along 165 deg West South along 90 deg West, South along 0 deg South along 180 deg, South along 90 deg West North along 130 deg West North along 140 deg East - Specified by:
compareTo
in interfaceComparable<DirectionAlongMeridian>
-
equals
Tests this object for equality with the specified one. This method is used mostly for assertions. -
hashCode
public int hashCode()Returns a hash code value, for consistency withequals(java.lang.Object)
. -
toString
Returns a string representation of this direction, using a syntax matching the one used by EPSG. This string representation will be used for creating a newAxisDirection
. The generated name should be identical to EPSG name, but we use the generated one anyway (rather than the one provided by EPSG) in order to make sure that we create a singleAxisDirection
for a given direction; we avoid potential differences like lower versus upper cases, amount of white space, etc.
-