geom_measure
Calculate geodesic distance and bearing between points, or measure a geometry's area and perimeter, using accurate ellipsoidal algorithms.
Instructions
Measure geodesic distance and bearing between points, or a geometry's area.
Distances use Karney's algorithm on the WGS84 ellipsoid, accurate to millimetres at any distance including near-antipodal pairs. Areas are computed on the ellipsoid, not in degree space.
This is straight-line ("as the crow flies") distance. For travel distance and time along real roads, use route_directions instead -- road distance is typically 20-40% longer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin | Yes | Start position, in any coordinate notation or as a place name. | |
| geojson | No | A GeoJSON or WKT geometry to measure instead of a point pair. Accepts a JSON object or a string. Returns geodesic area, perimeter, length, centroid and bounding box. | |
| destination | No | End position. Omit when measuring a geometry supplied in `geojson` instead. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta | Yes | ||
| compass | No | ||
| geometry | No | ||
| midpoint | No | ||
| distance_m | No | ||
| distance_km | No | ||
| distance_miles | No | ||
| final_bearing_deg | No | ||
| initial_bearing_deg | No | ||
| distance_nautical_miles | No |