Function GeodeticCoordinate.fromComponents
Make a latitude/longitude position with ellipsoidal height.
static GeodeticCoordinate fromComponents(
const Latitude!T latitude,
const Longitude!T longitude,
const T ellipsoidalHeight = 0
) @safe;
Use this form when invalid height should raise an exception. If the
height is unknown, use GeographicCoordinate instead of treating
it as zero.
Parameters
| Name | Description |
|---|---|
| latitude | Geodetic latitude. |
| longitude | Geodetic longitude. |
| ellipsoidalHeight | Finite ellipsoidal height in the caller-selected linear unit. When omitted, zero denotes an actual ellipsoidal height of zero; it does not mean unknown or absent height. |
Note
Use GeographicCoordinate for a horizontal geographic position
without height semantics.
Returns
The constructed coordinate.
Throws
GeodesyValueException when ellipsoidalHeight is NaN or infinite.
Example
Example constructing a geodetic coordinate.
import geodesy;
const point = GeodeticCoordinate!double .fromComponents(
Latitude!double .fromDegrees(48.0),
Longitude!double .fromDegrees(16.0),
171.0);
assert(point .ellipsoidalHeight == 171.0);