Modules@robinpath/geo
@robinpath/geo
0.1.0PublicGeolocation utilities: distance, bearing, geocoding, bounding box, polygon containment, DMS conversion
@robinpath/geo
Geolocation utilities: distance, bearing, geocoding, bounding box, polygon containment, DMS conversion
Why use this module?
The geo module lets you:
- Haversine distance between two points
- Bearing between two points
- Midpoint between two coordinates
- Destination point given start, bearing, and distance
- Bounding box around a point
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/geo
Quick Start
No credentials needed — start using it right away:
geo.bearing 40.7128 -74.0060 51.5074 -0.1278
Available Functions
| Function | Description |
|---|---|
geo.distance | Haversine distance between two points |
geo.bearing | Bearing between two points |
geo.midpoint | Midpoint between two coordinates |
geo.destination | Destination point given start, bearing, and distance |
geo.boundingBox | Bounding box around a point |
geo.isInBoundingBox | Check if point is inside bounding box |
geo.toRadians | Convert degrees to radians |
geo.toDegrees | Convert radians to degrees |
geo.toDMS | Convert decimal degrees to DMS string |
geo.fromDMS | Parse DMS string to decimal degrees |
geo.geocode | Forward geocode address to coordinates |
geo.reverseGeocode | Reverse geocode coordinates to address |
geo.polygon | Check if point is inside polygon |
geo.area | Calculate polygon area in sq km |
Examples
Bearing between two points
geo.bearing 40.7128 -74.0060 51.5074 -0.1278
Midpoint between two coordinates
geo.midpoint 40.7128 -74.0060 51.5074 -0.1278
Destination point given start, bearing, and distance
geo.destination 40.7128 -74.0060 45 100
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/geo";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
geo.bearing 40.7128 -74.0060 51.5074 -0.1278
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.0 | latest | yesterday |
Related Modules
utilities
1
@dev-tester/hello-world
v2.0.0dev-tester
Updated description
0 downloads
...
utilities
0
@robinpath/apollo
v0.1.1robinpath
Apollo module for RobinPath.
0 downloads
...
utilities
0
@robinpath/archive
v0.1.1robinpath
Create and extract .zip and .tar.gz file archives
0 downloads
...
utilities
0
@robinpath/assert
v0.1.1robinpath
Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more
0 downloads
...
Install
$ robinpath install @robinpath/geo Version0.1.0
LicenseMIT
Unpacked Size5.7 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

