public final class Longitude extends Angle
Longitudes are not necessarily relative to the Greenwich meridian. The prime meridian depends on the context, typically specified through the geodetic datum of a geographic CRS.
Latitude
,
AngleFormat
,
CoordinateFormat
,
Serialized FormDefined in the sis-utility
module
Modifier and Type | Field and Description |
---|---|
static double |
MAX_VALUE
Maximum usual value for longitude (+180.0°).
|
static double |
MIN_VALUE
Minimum usual value for longitude (-180.0°).
|
Constructor and Description |
---|
Longitude(DirectPosition position)
Constructs a newly allocated object containing the longitude value of the given position.
|
Longitude(double λ)
Construct a new longitude with the specified angular value.
|
Longitude(String string)
Constructs a newly allocated
Longitude object that contain the angular value
represented by the string. |
Modifier and Type | Method and Description |
---|---|
static double |
normalize(double λ)
|
public static final double MIN_VALUE
public static final double MAX_VALUE
public Longitude(double λ)
λ
- longitude value in decimal degrees.public Longitude(String string) throws NumberFormatException
Longitude
object that contain the angular value
represented by the string. The string should represent an angle in either fractional
degrees (e.g. 45.5°) or degrees with minutes and seconds (e.g. 45°30').
The hemisphere (E or W) is optional (default to East).
This is a convenience constructor mostly for testing purpose, since it uses a fixed
locale. Developers should consider using AngleFormat
for end-user applications
instead than this constructor.
string
- a string to be converted to a Longitude
.NumberFormatException
- if the string does not contain a parsable angle,
or represents a longitude angle.AngleFormat.parse(String)
public Longitude(DirectPosition position) throws IllegalArgumentException
If the axis direction is West, then the sign of the ordinate value is inverted. If the ordinate value uses another angular units than degrees, then a unit conversion is applied.
position
- the coordinate from which to extract the longitude value in degrees.IllegalArgumentException
- if the given coordinate it not associated to a CRS,
or if no axis oriented toward East or West is found, or if that axis does
not use angular units.public static double normalize(double λ)
Special cases:
λ
- the longitude value in decimal degrees.Latitude.clamp(double)
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.