Skip to main content

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​

ParameterTypeDescription
latnumberThe latitude, in degrees.
lonnumberThe 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​

LatLonInterface.lat


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​

LatLonInterface.lon

Methods​

antipode()​

antipode(out?): GeoPoint

Defined in: src/sdk/geo/GeoPoint.ts:570

Gets the antipode of this point.

Parameters​

ParameterTypeDescription
out?GeoPointThe GeoPoint to which to write the results. By default this point.

Returns​

GeoPoint

The antipode of this point.

Implementation of​

GeoPointInterface.antipode


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​
ParameterTypeDescription
otherLatLonInterfaceThe other point.
Returns​

number

The final true bearing from the other point, in degrees.

Implementation of​

GeoPointInterface.bearingFrom

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​
ParameterTypeDescription
latnumberThe latitude of the other point, in degrees.
lonnumberThe longitude of the other point, in degrees.
Returns​

number

The final true bearing from the other point, in degrees.

Implementation of​

GeoPointInterface.bearingFrom


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​
ParameterTypeDescription
otherLatLonInterfaceThe 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​
ParameterTypeDescription
latnumberThe latitude of the other point, in degrees.
lonnumberThe 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​
ParameterTypeDescription
otherLatLonInterfaceThe other point.
Returns​

number

The initial true bearing to the other point, in degrees.

Implementation of​

GeoPointInterface.bearingTo

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​
ParameterTypeDescription
latnumberThe latitude of the other point, in degrees.
lonnumberThe longitude of the other point, in degrees.
Returns​

number

The initial true bearing to the other point, in degrees.

Implementation of​

GeoPointInterface.bearingTo


copy()​

copy(to?): GeoPoint

Defined in: src/sdk/geo/GeoPoint.ts:600

Copies this point.

Parameters​

ParameterTypeDescription
to?GeoPointAn 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​

GeoPointInterface.copy


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​
ParameterTypeDescription
otherLatLonInterfaceThe point to which to calculate the distance.
Returns​

number

The great-circle distance to the other point, in great-arc radians.

Implementation of​

GeoPointInterface.distance

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​
ParameterTypeDescription
latnumberThe latitude of the point to which to calculate the distance.
lonnumberThe 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​

GeoPointInterface.distance


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​
ParameterTypeDescription
otherLatLonInterfaceThe 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​
ParameterTypeDescription
latnumberThe latitude of the other point, in degrees.
lonnumberThe 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​
ParameterTypeDescription
otherLatLonInterfaceThe other point.
tolerance?numberThe 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​

GeoPointInterface.equals

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​
ParameterTypeDescription
latnumberThe latitude of the other point, in degrees.
lonnumberThe longitude of the other point, in degrees.
tolerance?numberThe 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​

GeoPointInterface.equals


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​

ParameterTypeDescription
bearingnumberThe initial true bearing (forward azimuth), in degrees, by which to offset.
distancenumberThe distance, in great-arc radians, by which to offset.
out?GeoPointThe GeoPoint to which to write the result. By default this point.

Returns​

GeoPoint

The offset point.

Implementation of​

GeoPointInterface.offset


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​

ParameterTypeDescription
bearingnumberThe true bearing, in degrees, by which to offset.
distancenumberThe distance, in great-arc radians, by which to offset.
out?GeoPointThe GeoPoint to which to write the result. By default this point.

Returns​

GeoPoint

The offset point.

Implementation of​

GeoPointInterface.offsetRhumb


set()​

Call Signature​

set(other): this

Defined in: src/sdk/geo/GeoPoint.ts:396

Sets this point's latitude/longitude values.

Parameters​
ParameterTypeDescription
otherLatLonInterfaceThe 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​
ParameterTypeDescription
latnumberThe new latitude, in degrees.
lonnumberThe 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​
ParameterTypeDescription
vecReadonlyFloat64ArrayA 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​
ParameterTypeDescription
xnumberThe x component of a position vector defining the new coordinates.
ynumberThe y component of a position vector defining the new coordinates.
znumberThe 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​

ParameterTypeDescription
outFloat64ArrayThe vector array to which to write the result.

Returns​

Float64Array

The cartesian representation of this point.

Implementation of​

GeoPointInterface.toCartesian


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​

ParameterTypeDescription
lat1numberThe latitude of the initial point, in degrees.
lon1numberThe longitude of the initial point, in degrees.
lat2numberThe latitude of the final point, in degrees.
lon2numberThe 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​
ParameterTypeDescription
lat1numberThe latitude of the first point, in degrees.
lon1numberThe longitude of the first point, in degrees.
lat2numberThe latitude of the second point, in degrees.
lon2numberThe 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​
ParameterTypeDescription
point1LatLonInterfaceThe first point.
point2LatLonInterfaceThe 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​
ParameterTypeDescription
point1ReadonlyFloat64ArrayThe first point, in cartesian form.
point2ReadonlyFloat64ArrayThe 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​
ParameterTypeDescription
lat1numberThe latitude of the first point, in degrees.
lon1numberThe longitude of the first point, in degrees.
lat2numberThe latitude of the second point, in degrees.
lon2numberThe 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​
ParameterTypeDescription
point1LatLonInterfaceThe first point.
point2LatLonInterfaceThe 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​
ParameterTypeDescription
point1ReadonlyFloat64ArrayThe first point, in cartesian form.
point2ReadonlyFloat64ArrayThe 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​
ParameterTypeDescription
lat1numberThe latitude of the first point, in degrees.
lon1numberThe longitude of the first point, in degrees.
lat2numberThe latitude of the second point, in degrees.
lon2numberThe longitude of the second point, in degrees.
tolerance?numberThe 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​
ParameterTypeDescription
point1LatLonInterfaceThe first point.
point2LatLonInterfaceThe second point.
tolerance?numberThe 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​
ParameterTypeDescription
point1ReadonlyFloat64ArrayThe first point, in cartesian form.
point2ReadonlyFloat64ArrayThe second point, in cartesian form.
tolerance?numberThe 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​

ParameterTypeDescription
lat1numberThe latitude of the initial point, in degrees.
lon1numberThe longitude of the initial point, in degrees.
lat2numberThe latitude of the final point, in degrees.
lon2numberThe 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​

ParameterTypeDescription
lat1numberThe latitude of the initial point, in degrees.
lon1numberThe longitude of the initial point, in degrees.
lat2numberThe latitude of the final point, in degrees.
lon2numberThe 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​
ParameterTypeDescription
pointLatLonInterfaceThe point to convert.
outFloat64ArrayThe 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​
ParameterTypeDescription
latnumberThe latitude of the point to convert, in degrees.
lonnumberThe longitude of the point to convert, in degrees.
outFloat64ArrayThe vector array to which to write the result.
Returns​

Float64Array

the cartesian representation of the point.