public final class Latitude extends Angle
Because the Earth is not a perfect sphere, there is small differences in the latitude values of a point depending on how the latitude is defined:
Latitude
class, and rather depends on the context:
the latitude is geodetic if the coordinate reference system is
geographic,
or geocentric if the coordinate reference system is
geocentric.
If the context is unknown, then geodetic latitude can usually be assumed.
Longitude
,
AngleFormat
,
CoordinateFormat
,
Serialized FormDefined in the sis-utility
module
Modifier and Type | Field and Description |
---|---|
static double |
MAX_VALUE
Maximum usual value for latitude (+90.0°).
|
static double |
MIN_VALUE
Minimum usual value for latitude (-90.0°).
|
Constructor and Description |
---|
Latitude(DirectPosition position)
Constructs a newly allocated object containing the latitude value of the given position.
|
Latitude(double φ)
Construct a new latitude with the specified angular value.
|
Latitude(String string)
Constructs a newly allocated
Latitude object that contain the angular value
represented by the string. |
Modifier and Type | Method and Description |
---|---|
static double |
clamp(double φ)
|
public static final double MIN_VALUE
public static final double MAX_VALUE
public Latitude(double φ)
φ
- latitude value in decimal degrees.public Latitude(String string) throws NumberFormatException
Latitude
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 (N or S) is optional (default to North).
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 Latitude
.NumberFormatException
- if the string does not contain a parsable angle,
or represents a longitude angle.AngleFormat.parse(String)
public Latitude(DirectPosition position) throws IllegalArgumentException
If the axis direction is South, 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 latitude value in degrees.IllegalArgumentException
- if the given coordinate it not associated to a CRS,
or if no axis oriented toward North or South is found, or if that axis does
not use angular units.public static double clamp(double φ)
Special cases:
φ
- the latitude value in decimal degrees.Longitude.normalize(double)
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.