GeoPoint
A single point geometry, such as a specific location, address, or longitude, latitude pair.
Implements
Constructors
new GeoPoint()
new GeoPoint(): GeoPoint
Create a new GeoPoint object with default coordinates.
Returns
new GeoPoint()
new GeoPoint(geoJSONPosition, bbox?): GeoPoint
Create a new GeoPoint instance from another GeoJSONPosition coordinates.
Parameters
Parameter | Type |
---|---|
geoJSONPosition | Coordinates2D | Coordinates3D |
bbox ? | BBox2DLiteral | BBox3DLiteral | GeoBoundingBox |
Returns
new GeoPoint()
new GeoPoint(geoLocationCoordinates, bbox?): GeoPoint
Create a new GeoPoint instance from the browser's Geolocation API coordinates.
Parameters
Parameter | Type |
---|---|
geoLocationCoordinates | GeolocationCoordinatesLike |
bbox ? | BBox2DLiteral | BBox3DLiteral | GeoBoundingBox |
Returns
See
new GeoPoint()
new GeoPoint(latLngLiteral, bbox?): GeoPoint
Creates a new GeoPoint instance from a Google Maps API google.maps.LatLngLiteral | LatLngLiteral object.
Parameters
Parameter | Type |
---|---|
latLngLiteral | LatLngLiteral |
bbox ? | BBox2DLiteral | BBox3DLiteral | GeoBoundingBox |
Returns
new GeoPoint()
new GeoPoint(interpolatedCoords, bbox?): GeoPoint
Creates a new GeoPoint instance from internal coordinates.
Parameters
Parameter | Type |
---|---|
interpolatedCoords | InternalPointCoordinates |
bbox ? | BBox2DLiteral | BBox3DLiteral | GeoBoundingBox |
Returns
new GeoPoint()
new GeoPoint(latLng, bbox?): GeoPoint
Creates a new GeoPoint instance from a Google Maps API google.maps.LatLng | LatLng object.
Parameters
Parameter | Type |
---|---|
latLng | LatLngLiteral |
bbox ? | BBox2DLiteral | BBox3DLiteral | GeoBoundingBox |
Returns
new GeoPoint()
new GeoPoint(geoPointJSON, bbox?): GeoPoint
Create a new GeoPoint instance from another PointLiteral
.
Parameters
Parameter | Type |
---|---|
geoPointJSON | PointLiteral |
bbox ? | BBox2DLiteral | BBox3DLiteral | GeoBoundingBox |
Returns
new GeoPoint()
new GeoPoint(input, bbox?): GeoPoint
Create a new GeoPoint instance.
Parameters
Parameter | Type |
---|---|
input | GeoPointInput |
bbox ? | BBox2DLiteral | BBox3DLiteral | GeoBoundingBox |
Returns
Properties
boundingBox
boundingBox: null | GeoBoundingBox = null;
The bounding box literal of the GeoPoint.
See
GeoPoint.bbox
for the actual bounding box object.GeoBoundingBox
for creating a bounding box.
type
readonly type: "Point" = GeometryType.Point;
Declares the type of GeoJSON object as a Point
geometry.
Implementation of
Accessors
altitude
get altitude(): number
The altitude of the point, i.e. the z-coordinate.
This is optional and is typically measured in meters.
Default
0
set altitude(value): void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
number
bbox
get bbox(): undefined | BBox2DLiteral | BBox3DLiteral
The bounding box literal of the GeoPoint.
See
BBox2DLiteral
for 2D bounding boxes.BBox3DLiteral
for 3D bounding boxes.GeoBoundingBox
for creating a bounding box.
set bbox(bbox): void
A bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
This is useful when defining the extent of a GeoJSON object, i.e. the minimum and maximum coordinates of the object's Geometries, Features, or Feature Collections.
@TJS-type array @TJS-items.type number
See
Parameters
Parameter | Type |
---|---|
bbox | undefined | BBox2DLiteral | BBox3DLiteral |
Returns
undefined
| BBox2DLiteral
| BBox3DLiteral
A bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
This is useful when defining the extent of a GeoJSON object, i.e. the minimum and maximum coordinates of the object's Geometries, Features, or Feature Collections.
@TJS-type array @TJS-items.type number
See
Implementation of
coordinates
get coordinates(): Coordinates2D | Coordinates3D
A pair of coordinates in the form of [longitude, latitude].
@TJS-type array @TJS-items.type number
See
Point2DCoordinates
for more information.
set coordinates(coords): void
A pair of coordinates in the form of [longitude, latitude].
@TJS-type array @TJS-items.type number
See
Point2DCoordinates
for more information.
Parameters
Parameter | Type |
---|---|
coords | Coordinates2D | Coordinates3D |
Returns
A pair of coordinates in the form of [longitude, latitude].
@TJS-type array @TJS-items.type number
See
Point2DCoordinates
for more information.
Implementation of
latitude
get latitude(): number
The latitude of the point in degrees, i.e. the y-coordinate.
Values outside the range will be clamped to the poles.
set latitude(value): void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
number
longitude
get longitude(): number
The longitude of the point in degrees, i.e. the x-coordinate.
Values outside the range will be wrapped around to the opposite side of the globe.
set longitude(value): void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
number
Methods
[iterator]()
iterator: Iterator<number, any, any>
Returns
Iterator
<number
, any
, any
>
is2D()
is2D(): boolean
Whether the GeoPoint is 2-dimensional.
Returns
boolean
is3D()
is3D(): boolean
Whether the GeoPoint is 3-dimensional.
Returns
boolean
isNullIsland()
isNullIsland(): boolean
Whether the GeoPoint is the null island at 0, 0.
Returns
boolean
to2DCoordinates()
to2DCoordinates(): Coordinates2D
Returns
to3DCoordinates()
to3DCoordinates(): Coordinates3D
Returns
toDMS()
toDMS(): string
Converts the GeoPoint to DMS (Degrees, Minutes, Seconds) format.
Returns
string
toGoogleLatLngLiteral()
toGoogleLatLngLiteral(): LatLngLiteral
Converts the GeoPoint to a Google Maps API google.maps.LatLngLiteral | LatLngLiteral object.
Returns
LatLngLiteral
toH3Cell()
toH3Cell(resolution): H3Cell
Converts the GeoPoint to a H3 short cell address.
Parameters
Parameter | Type | Default value |
---|---|---|
resolution | number | 15 |
Returns
toH3ShortCell()
toH3ShortCell(resolution): H3CellShort
Converts the GeoPoint to a H3 short cell address.
Parameters
Parameter | Type | Default value |
---|---|---|
resolution | number | 15 |
Returns
toJSON()
toJSON(): PointLiteral
Returns
toString()
toString(): string
Returns a string representation of an object.
Returns
string
from()
static from(input): null | GeoPoint
Attempts to create a new GeoPoint instance from the given input.
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
null
| GeoPoint