Class: GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:321
A point on Earth's surface. This class uses a spherical Earth model.
Implements
Constructors
Constructor
new GeoPoint(
lat
,lon
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:340
Constructor.
Parameters
Parameter | Type | Description |
---|---|---|
lat | number | The latitude, in degrees. |
lon | number | The longitude, in degrees. |
Returns
GeoPoint
Properties
readonly
readonly
readonly:GeoPointReadOnly
Defined in: src/sdk/geo/GeoPoint.ts:333
EQUALITY_TOLERANCE
readonly
static
EQUALITY_TOLERANCE:1e-7
=1e-7
Defined in: src/sdk/geo/GeoPoint.ts:326
The default equality tolerance, defined as the maximum allowed distance between two equal points in great-arc radians.
Accessors
lat
Get Signature
get lat():
number
Defined in: src/sdk/geo/GeoPoint.ts:349
The latitude of this point, in degrees.
Returns
number
the latitude of this point.
The latitude of the point.
Implementation of
lon
Get Signature
get lon():
number
Defined in: src/sdk/geo/GeoPoint.ts:357
The longitude of this point, in degrees.
Returns
number
the longitude of this point.
The longitude of the point.
Implementation of
Methods
antipode()
antipode(
out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:570
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:486
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 | LatLonInterface | The other point. |
Returns
number
The final true bearing from the other point, in degrees.
Implementation of
Call Signature
bearingFrom(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:488
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.
Implementation of
bearingRhumb()
Call Signature
bearingRhumb(
other
):number
Defined in: src/sdk/geo/GeoPoint.ts:496
Calculates the constant true bearing from this point to another point along the rhumb line connecting the two.
Parameters
Parameter | Type | Description |
---|---|---|
other | 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:498
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:476
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 | LatLonInterface | The other point. |
Returns
number
The initial true bearing to the other point, in degrees.
Implementation of
Call Signature
bearingTo(
lat
,lon
):number
Defined in: src/sdk/geo/GeoPoint.ts:478
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.
Implementation of
copy()
copy(
to?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:600
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:456
Calculates the great-circle distance between this point and another point.
Parameters
Parameter | Type | Description |
---|---|---|
other | 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:458
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:466
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Parameter | Type | Description |
---|---|---|
other | 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:468
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:580
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.
Implementation of
Call Signature
equals(
lat
,lon
,tolerance?
):boolean
Defined in: src/sdk/geo/GeoPoint.ts:582
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
offset()
offset(
bearing
,distance
,out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:512
Offsets this point by an initial bearing and distance along a great circle.
Parameters
Parameter | Type | Description |
---|---|---|
bearing | number | The initial true bearing (forward azimuth), 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
offsetRhumb()
offsetRhumb(
bearing
,distance
,out?
):GeoPoint
Defined in: src/sdk/geo/GeoPoint.ts:539
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:396
Sets this point's latitude/longitude values.
Parameters
Parameter | Type | Description |
---|---|---|
other | 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:403
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:435
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:445
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:575
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:835
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:685
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:692
Calculates the great-circle distance between two points.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | LatLonInterface | The first point. |
point2 | 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:699
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:740
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:747
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | LatLonInterface | The first point. |
point2 | 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:754
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:641
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:650
Checks whether two points are equal.
Parameters
Parameter | Type | Description |
---|---|---|
point1 | LatLonInterface | The first point. |
point2 | 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:659
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:822
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.
initialBearing()
static
initialBearing(lat1
,lon1
,lat2
,lon2
):number
Defined in: src/sdk/geo/GeoPoint.ts:800
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.
sphericalToCartesian()
Call Signature
static
sphericalToCartesian(point
,out
):Float64Array
Defined in: src/sdk/geo/GeoPoint.ts:612
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 | 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:622
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.