Skip to main content

Nexus Spatial

This package contains a collection of utilities for working with spatial data.

Bounding Box

Type alias, FunctionDescription
BBox2DLiteralA 2-dimensional rectangular area that can be determined by two longitudes and two latitudes.
BBox3DLiteralA 3-dimensional rectangular area that can be determined by two longitudes, two latitudes, and two altitudes.
is2DBBoxType-predicate for 3-dimensional bounding boxes.
is3DBBoxType-predicate for 3-dimensional bounding boxes.
isBBoxType-predicate to determine if the given input is a bounding box.

Country

Enumeration, Type aliasDescription
CountryISO2-
CountryISO3ISO 3166-1 alpha-3 country code.
CountryNameName of a country in the world.

Geo

EnumerationDescription
CoordinateProjectionA coordinate system used to represent the Earth's surface.

GeoJSON

Type alias, FunctionDescription
BBox2DLiteralA 2-dimensional rectangular area that can be determined by two longitudes and two latitudes.
BBox3DLiteralA 3-dimensional rectangular area that can be determined by two longitudes, two latitudes, and two altitudes.
inferGeoJSONCoordOrderGiven an input which appears to be reversed GeoJSON coordinates (i.e. [latitude, longitude]), returns the coordinates in the correct order of [longitude, latitude].
is2DBBoxType-predicate for 3-dimensional bounding boxes.
is3DBBoxType-predicate for 3-dimensional bounding boxes.
isBBoxType-predicate to determine if the given input is a bounding box.
isGeoBoundingBoxType-predicate to determine if the given input is a GeoBoundingBox instance.
orderCoordPairToGeoJSONOrders the given coordinates as [longitude, latitude].
orderGeoJSONToCoordPairOrders the given coordinates as [latitude, longitude].

Geocoding

Type alias, FunctionDescription
GooglePlaceIDA Place ID uniquely identifies a place in the Google Places database and on Google Maps.
isGooglePlaceIDType-predicate for checking if a value appears to be a valid Google Place ID.

Geographic

Type alias, VariableDescription
CountryISO3ISO 3166-1 alpha-3 country code.
CountryNameName of a country in the world.
RegionNameA region of the world, i.e. a continent.
CountryNamesList of all countries in the world.
RegionNamesA list of geographic regions, i.e. continents.

Google

Type alias, FunctionDescription
GooglePlaceIDA Place ID uniquely identifies a place in the Google Places database and on Google Maps.
isGooglePlaceIDType-predicate for checking if a value appears to be a valid Google Place ID.

OSM

EnumerationDescription
OSMNodeTagTags returned by the Overpass API for a node.

Other

Class, Interface, Type alias, Variable, FunctionDescription
GeoBoundingBoxA bounding box to represent the coordinate range of a GeoJSON object.
GeoObjectAbstract base-class for all GeoJSON class constructors.
GeoPointA single point geometry, such as a specific location, address, or longitude, latitude pair.
GeoFeatureA feature object which contains a geometry and associated properties.
GeoFeatureCollectionA collection of feature objects.
GeolocationCoordinatesLikeCommon interface for Browser Geolocation API coordinates.
GeometryCollectionA GeoJSON Geometry Collection.
GeoObjectLiteralThe base GeoJSON object.
IdentifiableGeoFeature-
LineStringLiteralA collection of points forming a line, such as a road or a path.
MultiLineStringLiteralA collection of points forming a line, such as a road or a path.
MultiPointLiteralA collection of points, such as a constellation or a set of locations.
MultiPolygonLiteralA collection of polygons, such as a country with islands or a lake with islands.
OSMOverpassElement-
OSMOverpassResponseBody-
PointLiteralA JSON-serializeable single point geometry, such as a specific location, address, or longitude, latitude pair.
PolygonLiteralAn array of positions forming a closed shape, such as a country or a lake.
CastAsFeatureCollectionA utility type for wrapping a GeoFeature type in a GeoFeatureCollection.
Coordinates2DAn ordered pair of coordinates in the form of [longitude, latitude].
Coordinates3DAn ordered triple of coordinates in the form of [longitude, latitude, altitude].
ExtractFeatureTypeGiven a GeoFeatureCollection type, extract its feature type.
ExtractGeometryTypeGiven a GeoFeature type, extract its geometry type.
ExtractPropertiesTypeGiven a GeoFeature type, extract its properties type.
GeoBoundingBoxInputInput for creating a GeoBoundingBox instance.
GeometryLiteralUnion of the GeoJSON geometry types.
GeometryTypeGeoJSON object types.
GeoPointInput-
H3CellA H3 cell index, full 64 bits.
H3CellShortA H3 cell index, shortened to 48 bits.
InferGeoFeatureCollectionGiven a GeoFeature type, extract its feature collection type.
InternalPointCoordinatesA record of internal coordinates, typically used by the US Census.
LineStringPathAn array of positions forming a line, such as a road or a path.
MultiPointPathAn array of positions for each point in the geometry.
NestedPolygonPathAn array of positions forming a closed shape with holes, such as a country with islands or a lake with islands.
OSMNodeTagRecord-
PolygonPathA polygon geometry.
RegionCodeM.49 region code for a specific continent.
SolidPolygonPathAn array of positions forming a closed shape, such as a country or a lake.
Alpha3ToCountryRecordISO 3166-1 alpha-3 country codes to country names.
ForbiddenResidentialOSMNodeTags-
GeometryTypeShadow enum-like record of valid GeoJSON object types.
GOOGLE_PLACE_ID_PATTERNPattern for validating a Google Place ID.
RegionCodesM.49 region codes for continents.
RegionCodeToNameRecordContinent codes to their full names.
cellToPointLiteral-
clampLatitudeGiven a latitude value, clamps it to the range of [-90, 90].
expandH3CellGiven a short cell address, expand it to a full H3 cell index.
fetchOSMElementViaOverpassAPI-
isCoordPairLiteralType-predicate to determine if the given input is a GeoJSON Point geometry.
isGeolocationCoordinatesLikeType-predicate to determine if the given input appears to be a GeolocationCoordinates object.
isGoogleMapsLatLngLiteralType-predicate to determine if the given input is a LatLngLiteral object.
isH3Cell-
isInterpolatedCoordinatesType-predicate to determine if the given input is a InternalPointCoordinates object.
isPointLiteralType-predicate to determine if the given input is a GeoJSON Point geometry.
isPolygonLiteralPredicate for checking if a GeoJSON object is a Polygon geometry.
isResidentialElementGiven an OSM element, attempts to infer if the result is a residential address.
isSolidPolygonPathPredicate for checking if a polygon geometry is a solid, i.e. it has no holes.
polygonToOSMFilterGiven a polygon geometry, return an OSM filter string.
shortCellToPointGiven a geographic point, return a short cell address.
shortenH3CellGiven a full H3 cell index, shorten it to 48 bits.
wrapLongitudeGiven a longitude value, wraps it to the range of [-180, 180].

Position

FunctionDescription
inferGeoJSONCoordOrderGiven an input which appears to be reversed GeoJSON coordinates (i.e. [latitude, longitude]), returns the coordinates in the correct order of [longitude, latitude].
orderCoordPairToGeoJSONOrders the given coordinates as [longitude, latitude].
orderGeoJSONToCoordPairOrders the given coordinates as [latitude, longitude].