Street routing

Snap coordinates to the network

Find the nearest road or path network locations for given coordinates. Useful for debugging routes.

post/valhalla/locate

Request

  • Base URL: https://transit.land/api/v2/routing
  • URL: https://transit.land/api/v2/routing/valhalla/locate
  • 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'

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'
verboseboolean

Return dense edge and node attribution. When false, only the closest point, way ID, and side of street are returned.

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",
  "locations": [
    {
      "preferred_side": "opposite",
      "search_filter": {
        "max_road_class": "primary",
        "min_road_class": "primary"
      },
      "street_side_cutoff": "primary",
      "type": "break"
    }
  ]
}

Response

Successful response

input_latnumber double

Latitude as requested.

input_lonnumber double

Longitude as requested.

reasonstring

Why nothing was found. Verbose only, and present only when edges is null.

Example response

[
  {
    "reason": "No data found for location"
  }
]

Changes

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