Get trail geometry clipped to a box
get_route_segmentsGet route geometry clipped to a WGS84 bounding box as GeoJSON. Specify route IDs, bounding box, and activity type to retrieve trail segments for a map viewport.
Instructions
Get the on-map geometry of one or more routes, clipped to a WGS84 lon/lat bounding box, as GeoJSON (reprojected to lon/lat). Useful for drawing the part of a trail inside a map viewport. Geometry is summarised by default; set geometry_detail to 'full' for all coordinates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | OSM relation ids whose geometry to return. | |
| min_lon | Yes | Western longitude of the clip box. | |
| min_lat | Yes | Southern latitude of the clip box. | |
| max_lon | Yes | Eastern longitude of the clip box. | |
| max_lat | Yes | Northern latitude of the clip box. | |
| geometry_detail | No | Geometry verbosity: 'none', 'summary' (default), or 'full'. | summary |
| flavour | No | Which activity map to query: hiking, cycling, mtb (mountain biking), riding (horse), skating (inline), or slopes (ski/winter). Defaults to hiking. | hiking |