Function ProjectedCoordinate.tryFromComponents
Construct from finite easting and northing without throwing.
static bool tryFromComponents(
const T easting,
const T northing,
out ProjectedCoordinate result
) pure nothrow @nogc @safe;
Parameters
| Name | Description |
|---|---|
| easting | Finite easting in the caller-selected linear unit. |
| northing | Finite northing in the same linear unit. |
| result | Receives the constructed coordinate on success. |
Returns
true on success; false when either component is NaN or
infinite. On failure result is initialized to on entry and has no guaranteed value on failure.
Example
Example checking projected coordinates without throwing.
import geodesy;
ProjectedCoordinate!double point;
assert(ProjectedCoordinate!double .tryFromComponents(
500_000.0, 5_340_000.0, point));
assert(point .easting == 500_000.0);