Class: GeoPoint
A point on Earth's surface. This class uses a spherical Earth model.
Implements
Constructors
constructor
• new GeoPoint(lat
, lon
): GeoPoint
Constructor.
Parameters
Name | Type | Description |
---|---|---|
lat | number | The latitude, in degrees. |
lon | number | The longitude, in degrees. |
Returns
Defined in
src/sdk/geo/GeoPoint.ts:340
Properties
readonly
• Readonly
readonly: GeoPointReadOnly
Defined in
src/sdk/geo/GeoPoint.ts:333
EQUALITY_TOLERANCE
▪ Static
Readonly
EQUALITY_TOLERANCE: 1e-7
The default equality tolerance, defined as the maximum allowed distance between two equal points in great-arc radians.
Defined in
src/sdk/geo/GeoPoint.ts:326
Accessors
lat
• get
lat(): number
The latitude of this point, in degrees.
Returns
number
the latitude of this point.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:349
lon
• get
lon(): number
The longitude of this point, in degrees.
Returns
number
the longitude of this point.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:357
Methods
antipode
▸ antipode(out?
): GeoPoint
Gets the antipode of this point.
Parameters
Name | Type | Description |
---|---|---|
out? | GeoPoint | The GeoPoint to which to write the results. By default this point. |
Returns
The antipode of this point.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:570
bearingFrom
▸ bearingFrom(other
): number
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
Name | Type | Description |
---|---|---|
other | LatLonInterface | The other point. |
Returns
number
The final true bearing from the other point, in degrees.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:486
▸ bearingFrom(lat
, lon
): number
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
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:488
bearingRhumb
▸ bearingRhumb(other
): number
Calculates the constant true bearing from this point to another point along the rhumb line connecting the two.
Parameters
Name | Type | Description |
---|---|---|
other | LatLonInterface | The other point. |
Returns
number
The constant true bearing to the other point, in degrees.
Implementation of
GeoPointInterface.bearingRhumb
Defined in
src/sdk/geo/GeoPoint.ts:496
▸ bearingRhumb(lat
, lon
): number
Calculates the constant true bearing from this point to another point along the rhumb line connecting the two.
Parameters
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:498
bearingTo
▸ bearingTo(other
): number
Calculates the initial true bearing (forward azimuth) from this point to another point along the great circle connecting the two.
Parameters
Name | Type | Description |
---|---|---|
other | LatLonInterface | The other point. |
Returns
number
The initial true bearing to the other point, in degrees.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:476
▸ bearingTo(lat
, lon
): number
Calculates the initial true bearing (forward azimuth) from this point to another point along the great circle connecting the two.
Parameters
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:478
copy
▸ copy(to?
): GeoPoint
Copies this point.
Parameters
Name | 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.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:600
distance
▸ distance(other
): number
Calculates the great-circle distance between this point and another point.
Parameters
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:456
▸ distance(lat
, lon
): number
Calculates the great-circle distance between this point and another point.
Parameters
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:458
distanceRhumb
▸ distanceRhumb(other
): number
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:466
▸ distanceRhumb(lat
, lon
): number
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:468
equals
▸ equals(other
, tolerance?
): boolean
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
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:580
▸ equals(lat
, lon
, tolerance?
): boolean
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
Name | 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
Defined in
src/sdk/geo/GeoPoint.ts:582
offset
▸ offset(bearing
, distance
, out?
): GeoPoint
Offsets this point by an initial bearing and distance along a great circle.
Parameters
Name | 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
The offset point.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:512
offsetRhumb
▸ offsetRhumb(bearing
, distance
, out?
): GeoPoint
Offsets this point by a constant bearing and distance along a rhumb line.
Parameters
Name | 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
The offset point.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:539
set
▸ set(other
): this
Sets this point's latitude/longitude values.
Parameters
Name | Type | Description |
---|---|---|
other | LatLonInterface | The point from which to take the new latitude/longitude values. |
Returns
this
This point, after it has been changed.
Defined in
src/sdk/geo/GeoPoint.ts:396
▸ set(lat
, lon
): this
Sets this point's latitude/longitude values.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:403
setFromCartesian
▸ setFromCartesian(vec
): this
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
Name | Type | Description |
---|---|---|
vec | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | A position vector defining the new coordinates. |
Returns
this
This point, after it has been changed.
Defined in
src/sdk/geo/GeoPoint.ts:435
▸ setFromCartesian(x
, y
, z
): this
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
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:445
toCartesian
▸ toCartesian(out
): Float64Array
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
Name | Type | Description |
---|---|---|
out | Float64Array | The vector array to which to write the result. |
Returns
Float64Array
The cartesian representation of this point.
Implementation of
Defined in
src/sdk/geo/GeoPoint.ts:575
bearingRhumb
▸ bearingRhumb(lat1
, lon1
, lat2
, lon2
): number
Calculates the constant true bearing from one point to another along the rhumb line connecting the two.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:835
distance
▸ distance(lat1
, lon1
, lat2
, lon2
): number
Calculates the great-circle distance between two points.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:685
▸ distance(point1
, point2
): number
Calculates the great-circle distance between two points.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:692
▸ distance(point1
, point2
): number
Calculates the great-circle distance between two points.
Parameters
Name | Type | Description |
---|---|---|
point1 | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The first point, in cartesian form. |
point2 | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The second point, in cartesian form. |
Returns
number
The great-circle distance between the two points, in great-arc radians.
Defined in
src/sdk/geo/GeoPoint.ts:699
distanceRhumb
▸ distanceRhumb(lat1
, lon1
, lat2
, lon2
): number
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:740
▸ distanceRhumb(point1
, point2
): number
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:747
▸ distanceRhumb(point1
, point2
): number
Calculates the distance along the rhumb line connecting this point with another point.
Parameters
Name | Type | Description |
---|---|---|
point1 | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The first point, in cartesian form. |
point2 | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The second point, in cartesian form. |
Returns
number
The distance along the rhumb line connecting the two points, in great-arc radians.
Defined in
src/sdk/geo/GeoPoint.ts:754
equals
▸ equals(lat1
, lon1
, lat2
, lon2
, tolerance?
): boolean
Checks whether two points are equal.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:641
▸ equals(point1
, point2
, tolerance?
): boolean
Checks whether two points are equal.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:650
▸ equals(point1
, point2
, tolerance?
): boolean
Checks whether two points are equal.
Parameters
Name | Type | Description |
---|---|---|
point1 | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The first point, in cartesian form. |
point2 | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | 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.
Defined in
src/sdk/geo/GeoPoint.ts:659
finalBearing
▸ finalBearing(lat1
, lon1
, lat2
, lon2
): number
Calculates the final true bearing from one point to another along the great circle connecting the two.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:822
initialBearing
▸ initialBearing(lat1
, lon1
, lat2
, lon2
): number
Calculates the initial true bearing (forward azimuth) from one point to another along the great circle connecting the two.
Parameters
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:800
sphericalToCartesian
▸ sphericalToCartesian(point
, out
): Float64Array
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
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:612
▸ sphericalToCartesian(lat
, lon
, out
): Float64Array
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
Name | 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.
Defined in
src/sdk/geo/GeoPoint.ts:622