Class: GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:346
A point on Earth's surface. This class uses a spherical Earth model.
Implements
GeoPointInterface
Readonly
<LatLonInterface
>
Constructors
Constructor
new GeoPoint(
lat
,lon
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:369
Constructor.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude, in degrees. |
lon | number | The longitude, in degrees. |
Returns
GeoPoint
Properties
lat
readonly
lat:0
=0
Defined in: src/sdk/geo/GeoPoint.ts:357
The latitude of this point, in degrees.
Implementation of
lon
readonly
lon:0
=0
Defined in: src/sdk/geo/GeoPoint.ts:359
The longitude of this point, in degrees.
Implementation of
readonly
readonly
readonly:GeoPointReadOnly
Defined in: src/sdk/geo/GeoPoint.ts:362
A readonly version of this point.
EQUALITY_TOLERANCE
readonly
static
EQUALITY_TOLERANCE:1e-7
=GeoMath.ANGULAR_TOLERANCE
Defined in: src/sdk/geo/GeoPoint.ts:351
The default equality tolerance, defined as the maximum allowed distance between two equal points in great-arc radians.
Methods
antipode()
antipode(
out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:606
Gets the antipode of this point.
Parameters
Parameter | Type | Description |
---|---|---|
out? | GeoPoint | The GeoPoint to which to write the results. By default this point. |
Returns
GeoPoint
The antipode of this point.
Implementation of
bearingFrom()
Call Signature
bearingFrom(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:504
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.
Implementation of
Call Signature
bearingFrom(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:506
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.
Implementation of
bearingRhumb()
Call Signature
bearingRhumb(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:514
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.
Implementation of
GeoPointInterface
.bearingRhumb
Call Signature
bearingRhumb(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:516
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.
Implementation of
GeoPointInterface
.bearingRhumb
bearingTo()
Call Signature
bearingTo(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:494
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.
Implementation of
Call Signature
bearingTo(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:496
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.
Implementation of
copy()
copy(
to?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:636
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
GeoPoint
A copy of this point.
Implementation of
distance()
Call Signature
distance(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:474
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.
Implementation of
Call Signature
distance(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:476
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.
Implementation of
distanceRhumb()
Call Signature
distanceRhumb(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:484
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.
Implementation of
GeoPointInterface
.distanceRhumb
Call Signature
distanceRhumb(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:486
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.
Implementation of
GeoPointInterface
.distanceRhumb
equals()
Call Signature
equals(
other
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:616
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 | Readonly <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.
Implementation of
Call Signature
equals(
lat
,lon
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:618
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.
Implementation of
isValid()
isValid():
boolean
Defined in: src/sdk/geo/GeoPoint.ts:405
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.
Implementation of
offset()
offset(
bearing
,distance
,out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:532
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. By default this point. |
Returns
GeoPoint
The offset point.
Implementation of
offsetRhumb()
offsetRhumb(
bearing
,distance
,out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:575
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. By default this point. |
Returns
GeoPoint
The offset point.
Implementation of
set()
Call Signature
set(
other
):this
Defined in: src/sdk/geo/GeoPoint.ts:414
Sets this point's latitude/longitude values.
Parameters
Parameter | Type | Description |
---|---|---|
other | Readonly <LatLonInterface > | The point from which to take the new latitude/longitude values. |
Returns
this
This point, after it has been changed.
Call Signature
set(
lat
,lon
):this
Defined in: src/sdk/geo/GeoPoint.ts:421
Sets this point's latitude/longitude values.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The new latitude, in degrees. |
lon | number | The new longitude, in degrees. |
Returns
this
This point, after it has been changed.
setFromCartesian()
Call Signature
setFromCartesian(
vec
):this
Defined in: src/sdk/geo/GeoPoint.ts:453
Sets this point's coordinate values from a cartesian position vector. 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 |
---|---|---|
vec | ReadonlyFloat64Array | A position vector defining the new coordinates. |
Returns
this
This point, after it has been changed.
Call Signature
setFromCartesian(
x
,y
,z
):this
Defined in: src/sdk/geo/GeoPoint.ts:463
Sets this point's coordinate values from a cartesian position vector. 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 |
---|---|---|
x | number | The x component of a position vector defining the new coordinates. |
y | number | The y component of a position vector defining the new coordinates. |
z | number | The z component of a position vector defining the new coordinates. |
Returns
this
This point, after it has been changed.
toCartesian()
toCartesian(
out
):Float64Array
Defined in: src/sdk/geo/GeoPoint.ts:611
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.
Implementation of
bearingRhumb()
static
bearingRhumb(lat1
,lon1
,lat2
,lon2
):number
Defined in: src/sdk/geo/GeoPoint.ts:891
Calculates the constant true bearing from one point to another along the rhumb line connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
lat1 | number | The latitude of the initial point, in degrees. |
lon1 | number | The longitude of the initial point, in degrees. |
lat2 | number | The latitude of the final point, in degrees. |
lon2 | number | The longitude of the final point, in degrees. |
Returns
number
The constant true bearing, in degrees, from the initial point to the final point along the rhumb line connecting the two.
distance()
Call Signature
static
distance(lat1
,lon1
,lat2
,lon2
):number
Defined in: src/sdk/geo/GeoPoint.ts:721
Calculates the great-circle distance between two points.
Parameters
Parameter | Type | Description |
---|---|---|
lat1 | number | The latitude of the first point, in degrees. |
lon1 | number | The longitude of the first point, in degrees. |
lat2 | number | The latitude of the second point, in degrees. |
lon2 | number | The longitude of the second point, in degrees. |
Returns
number
The great-circle distance between the two points, in great-arc radians.
Call Signature
static
distance(point1
,point2
):number
Defined in: src/sdk/geo/GeoPoint.ts:728
Calculates the great-circle distance between two points.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | Readonly <LatLonInterface > | The first point. |
point2 | Readonly <LatLonInterface > | The second point. |
Returns
number
The great-circle distance between the two points, in great-arc radians.
Call Signature
static
distance(point1
,point2
):number
Defined in: src/sdk/geo/GeoPoint.ts:735
Calculates the great-circle distance between two points.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | ReadonlyFloat64Array | The first point, in cartesian form. |
point2 | ReadonlyFloat64Array | The second point, in cartesian form. |
Returns
number
The great-circle distance between the two points, in great-arc radians.
distanceRhumb()
Call Signature
static
distanceRhumb(lat1
,lon1
,lat2
,lon2
):number
Defined in: src/sdk/geo/GeoPoint.ts:781
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Parameter | Type | Description |
---|---|---|
lat1 | number | The latitude of the first point, in degrees. |
lon1 | number | The longitude of the first point, in degrees. |
lat2 | number | The latitude of the second point, in degrees. |
lon2 | number | The longitude of the second point, in degrees. |
Returns
number
The distance along the rhumb line connecting the two points, in great-arc radians.
Call Signature
static
distanceRhumb(point1
,point2
):number
Defined in: src/sdk/geo/GeoPoint.ts:788
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | Readonly <LatLonInterface > | The first point. |
point2 | Readonly <LatLonInterface > | The second point. |
Returns
number
The distance along the rhumb line connecting the two points, in great-arc radians.
Call Signature
static
distanceRhumb(point1
,point2
):number
Defined in: src/sdk/geo/GeoPoint.ts:795
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | ReadonlyFloat64Array | The first point, in cartesian form. |
point2 | ReadonlyFloat64Array | The second point, in cartesian form. |
Returns
number
The distance along the rhumb line connecting the two points, in great-arc radians.
equals()
Call Signature
static
equals(lat1
,lon1
,lat2
,lon2
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:677
Checks whether two points are equal.
Parameters
Parameter | Type | Description |
---|---|---|
lat1 | number | The latitude of the first point, in degrees. |
lon1 | number | The longitude of the first point, in degrees. |
lat2 | number | The latitude of the second point, in degrees. |
lon2 | number | The longitude of the second 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. Defaults to GeoPoint.EQUALITY_TOLERANCE . |
Returns
boolean
Whether the two points are equal.
Call Signature
static
equals(point1
,point2
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:686
Checks whether two points are equal.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | Readonly <LatLonInterface > | The first point. |
point2 | Readonly <LatLonInterface > | The second point. |
tolerance? | number | The tolerance of the equality check, defined as the maximum allowed distance between two equal points in great-arc radians. Defaults to GeoPoint.EQUALITY_TOLERANCE . |
Returns
boolean
Whether the two points are equal.
Call Signature
static
equals(point1
,point2
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:695
Checks whether two points are equal.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | ReadonlyFloat64Array | The first point, in cartesian form. |
point2 | ReadonlyFloat64Array | The second point, in cartesian form. |
tolerance? | number | The tolerance of the equality check, defined as the maximum allowed distance between two equal points in great-arc radians. Defaults to GeoPoint.EQUALITY_TOLERANCE . |
Returns
boolean
Whether the two points are equal.
finalBearing()
static
finalBearing(lat1
,lon1
,lat2
,lon2
):number
Defined in: src/sdk/geo/GeoPoint.ts:878
Calculates the final true bearing from one point to another along the great circle connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
lat1 | number | The latitude of the initial point, in degrees. |
lon1 | number | The longitude of the initial point, in degrees. |
lat2 | number | The latitude of the final point, in degrees. |
lon2 | number | The longitude of the final point, in degrees. |
Returns
number
The final true bearing, in degrees, from the initial point to the final point along the great circle
connecting the two, or NaN
if the two points are coincident or antipodal. If the final point is one of the
poles, then the bearing will be expressed relative to the direction in which the meridian defined by the final
point's longitude crosses the pole rather than true north.
initialBearing()
static
initialBearing(lat1
,lon1
,lat2
,lon2
):number
Defined in: src/sdk/geo/GeoPoint.ts:848
Calculates the initial true bearing (forward azimuth) from one point to another along the great circle connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
lat1 | number | The latitude of the initial point, in degrees. |
lon1 | number | The longitude of the initial point, in degrees. |
lat2 | number | The latitude of the final point, in degrees. |
lon2 | number | The longitude of the final point, in degrees. |
Returns
number
The initial true bearing, in degrees, from the initial point to the final point along the great circle
connecting the two, or NaN
if the two points are coincident or antipodal. If the initial point is one of the
poles, then the bearing will be expressed relative to the direction in which the meridian defined by the initial
point's longitude crosses the pole rather than true north.
sphericalToCartesian()
Call Signature
static
sphericalToCartesian(point
,out
):Float64Array
Defined in: src/sdk/geo/GeoPoint.ts:648
Calculates the cartesian (x, y, z) representation of a 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 |
---|---|---|
point | Readonly <LatLonInterface > | The point to convert. |
out | Float64Array | The vector array to which to write the result. |
Returns
Float64Array
the cartesian representation of the point.
Call Signature
static
sphericalToCartesian(lat
,lon
,out
):Float64Array
Defined in: src/sdk/geo/GeoPoint.ts:658
Calculates the cartesian (x, y, z) representation of a 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 |
---|---|---|
lat | number | The latitude of the point to convert, in degrees. |
lon | number | The longitude of the point to convert, in degrees. |
out | Float64Array | The vector array to which to write the result. |
Returns
Float64Array
the cartesian representation of the point.