Points on the Earth, as plain functions
geo gives the distance, the bearing, the area that holds a place, the box and the geohash. It has no dependencies on a map library. Move the place, turn the globe, or draw an area.
pnpm add @mark1russell7/geo
What the package has
- Distance and bearing
distanceKminitialBearingdestinationKmcentralAngleRadians- Places and areas
locatePointdistanceToGeometryKmpolygonsIntersectpolygonIntersectsBBox- Boxes
bboxOfPointsbboxOfGeoJsonbboxContainsbboxIntersectsbboxCenter- Geohash
geohashdecodeGeohashgeohashNeighborsgeohashesInBBox- GeoJSON
parseGeoJsonparseGeometryrewindringWinding- Maps of regions
simplifyRegionsregionSimplifier
Each edge of a polygon is a straight line in longitude and latitude, as RFC 7946 tells. Releases shows each version, and Status shows the open work.