Street routing

Trace the routing graph expansion

Return the edges explored while answering a routing request, as GeoJSON. Useful for visualizing and debugging searches.

post/valhalla/expansion

Request

  • Base URL: https://transit.land/api/v2/routing
  • URL: https://transit.land/api/v2/routing/valhalla/expansion
  • Auth: one of:
    • API key in header apikey
    • API key in query parameter apikey

Request body

costing'auto' | 'bicycle' | 'pedestrian' | 'truck' | 'bus' | 'taxi' | 'motor_scooter' | 'motorcycle' | 'bikeshare' | 'auto_pedestrian' required

multimodal is not available. The street graph has no transit; use transit routing at /api/v2/routing/otp/plan.

format'json' | 'gpx' | 'osrm' | 'pbf' | 'geotiff' | 'mvt'

Not all formats are supported by all endpoints, e.g. geotiff is isochrone-only.

idstring

Arbitrary request identifier echoed in the response.

languagestring

BCP47 locale for narrative output. See locales/ for supported values.

units'km' | 'miles' | 'mi'
action'route' | 'isochrone' | 'sources_to_targets' required

Algorithm to expand.

dedupeboolean

Emit each edge only once.

expansion_propertiesValhallaExpansionProperty[]
skip_oppositesboolean

Skip reverse-direction edges in the output.

Example request

{
  "costing": "auto",
  "exclude_locations": [
    {
      "preferred_side": "opposite",
      "search_filter": {
        "max_road_class": "primary",
        "min_road_class": "primary"
      },
      "street_side_cutoff": "primary",
      "type": "break"
    }
  ],
  "format": "json",
  "expansion_properties": [
    "duration"
  ],
  "locations": [
    {
      "preferred_side": "opposite",
      "search_filter": {
        "max_road_class": "primary",
        "min_road_class": "primary"
      },
      "street_side_cutoff": "primary",
      "type": "break"
    }
  ]
}

Response

Successful response

type'FeatureCollection'

GeoJSON collection type.

Example response

{
  "properties": {
    "algorithm": "dijkstras"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.