Interface: GeoPointInterface
Defined in: src/sdk/geo/GeoPoint.ts:9
A representation of a point on Earth's surface.
Properties
lat
readonly
lat:number
Defined in: src/sdk/geo/GeoPoint.ts:11
The latitude of this point, in degrees.
lon
readonly
lon:number
Defined in: src/sdk/geo/GeoPoint.ts:14
The longitude of this point, in degrees.
Methods
antipode()
antipode(
out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:129
Gets the antipode of this point.
Parameters
Parameter | Type | Description |
---|---|---|
out? | GeoPoint | The GeoPoint to which to write the result. |
Returns
The antipode of this point.
bearingFrom()
Call Signature
bearingFrom(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:78
Calculates the final true bearing from another point to this point (i.e. the back azimuth from this point to the other point) along the great circle connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
other | Readonly <LatLonInterface > | The other point. |
Returns
number
The final true bearing from the other point, in degrees, or NaN
if this point and the other point are
coincident or antipodal. If this point is one of the poles, then the bearing will be expressed relative to the
direction in which the meridian defined by this point's longitude crosses the pole rather than true north.
Call Signature
bearingFrom(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:88
Calculates the final true bearing from another point to this point (i.e. the back azimuth from this point to the other point) along the great circle connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the other point, in degrees. |
lon | number | The longitude of the other point, in degrees. |
Returns
number
The final true bearing from the other point, in degrees, or NaN
if this point and the other point are
coincident or antipodal. If this point is one of the poles, then the bearing will be expressed relative to the
direction in which the meridian defined by this point's longitude crosses the pole rather than true north.
bearingRhumb()
Call Signature
bearingRhumb(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:95
Calculates the constant true bearing from this point to another point along the rhumb line connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
other | Readonly <LatLonInterface > | The other point. |
Returns
number
The constant true bearing to the other point, in degrees.
Call Signature
bearingRhumb(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:102
Calculates the constant true bearing from this point to another point along the rhumb line connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the other point, in degrees. |
lon | number | The longitude of the other point, in degrees. |
Returns
number
The constant true bearing to the other point, in degrees.
bearingTo()
Call Signature
bearingTo(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:58
Calculates the initial true bearing (forward azimuth) from this point to another point along the great circle connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
other | Readonly <LatLonInterface > | The other point. |
Returns
number
The initial true bearing to the other point, in degrees, or NaN
if this point and the other point are
coincident or antipodal. If this point is one of the poles, then the bearing will be expressed relative to the
direction in which the meridian defined by this point's longitude crosses the pole rather than true north.
Call Signature
bearingTo(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:68
Calculates the initial true bearing (forward azimuth) from this point to another point along the great circle connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the other point, in degrees. |
lon | number | The longitude of the other point, in degrees. |
Returns
number
The initial true bearing to the other point, in degrees, or NaN
if this point and the other point are
coincident or antipodal. If this point is one of the poles, then the bearing will be expressed relative to the
direction in which the meridian defined by this point's longitude crosses the pole rather than true north.
copy()
copy(
to?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:168
Copies this point.
Parameters
Parameter | Type | Description |
---|---|---|
to? | GeoPoint | An optional point to which to copy this point. If this argument is not supplied, a new GeoPoint object will be created. |
Returns
A copy of this point.
distance()
Call Signature
distance(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:27
Calculates the great-circle distance between this point and another point.
Parameters
Parameter | Type | Description |
---|---|---|
other | Readonly <LatLonInterface > | The point to which to calculate the distance. |
Returns
number
The great-circle distance to the other point, in great-arc radians.
Call Signature
distance(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:34
Calculates the great-circle distance between this point and another point.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the point to which to calculate the distance. |
lon | number | The longitude of the point to which to calculate the distance. |
Returns
number
The great-circle distance to the other point, in great-arc radians.
distanceRhumb()
Call Signature
distanceRhumb(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:41
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Parameter | Type | Description |
---|---|---|
other | Readonly <LatLonInterface > | The other point. |
Returns
number
The rhumb-line distance to the other point, in great-arc radians.
Call Signature
distanceRhumb(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:48
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the other point, in degrees. |
lon | number | The longitude of the other point, in degrees. |
Returns
number
The rhumb-line distance to the other point, in great-arc radians.
equals()
Call Signature
equals(
other
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:149
Checks whether this point is equal to another point. Two points are considered equal if and only if the great-
circle distance between them is less than or equal to a specified tolerance or if the latitude and longitude
components of both points are equal to NaN
.
Parameters
Parameter | Type | Description |
---|---|---|
other | LatLonInterface | The other point. |
tolerance? | number | The tolerance of the equality check, defined as the maximum allowed distance between two equal points in great-arc radians. |
Returns
boolean
Whether this point is equal to the other point.
Call Signature
equals(
lat
,lon
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:160
Checks whether this point is equal to another point. Two points are considered equal if and only if the great-
circle distance between them is less than or equal to a specified tolerance or if the latitude and longitude
components of both points are equal to NaN
.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude of the other point, in degrees. |
lon | number | The longitude of the other point, in degrees. |
tolerance? | number | The tolerance of the equality check, defined as the maximum allowed distance between two equal points in great-arc radians. |
Returns
boolean
Whether this point is equal to the other point.
isValid()
isValid():
boolean
Defined in: src/sdk/geo/GeoPoint.ts:20
Checks whether this point is valid. This point is valid if and only if both latitude and longitude are finite.
Returns
boolean
Whether this point is valid.
offset()
offset(
bearing
,distance
,out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:113
Offsets this point by an initial bearing and distance along a great circle.
Parameters
Parameter | Type | Description |
---|---|---|
bearing | number | The bearing along which to offset, in degrees relative to true north. If this point is one of the poles, then the bearing will be measured relative to the direction in which the meridian defined by this point's longitude crosses the pole rather than the direction of true north. |
distance | number | The distance, in great-arc radians, by which to offset. |
out? | GeoPoint | The GeoPoint to which to write the result. |
Returns
The offset point.
offsetRhumb()
offsetRhumb(
bearing
,distance
,out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:122
Offsets this point by a constant bearing and distance along a rhumb line.
Parameters
Parameter | Type | Description |
---|---|---|
bearing | number | The true bearing, in degrees, by which to offset. |
distance | number | The distance, in great-arc radians, by which to offset. |
out? | GeoPoint | The GeoPoint to which to write the result. |
Returns
The offset point.
toCartesian()
toCartesian(
out
):Float64Array
Defined in: src/sdk/geo/GeoPoint.ts:138
Calculates the cartesian (x, y, z) representation of this point, in units of great-arc radians. By convention, in the cartesian coordinate system the origin is at the center of the Earth, the positive x-axis passes through 0 degrees N, 0 degrees E, and the positive z-axis passes through the north pole.
Parameters
Parameter | Type | Description |
---|---|---|
out | Float64Array | The vector array to which to write the result. |
Returns
Float64Array
The cartesian representation of this point.