Valhalla · Schema

MatrixRequest

Request body for the Valhalla /sources_to_targets endpoint. Computes time and distance matrices between sets of origins and destinations.

RoutingNavigationOpenStreetMapMappingGeospatialDirectionsIsochronesTravelTransportationOpen Source

Properties

Name Type Description
sources array Origin locations.
targets array Destination locations.
costing string Travel mode costing model.
costing_options object Per-costing-model fine-tuning options.
id string Arbitrary request identifier echoed in the response.
units string
verbose boolean Include detailed per-cell metadata in the response.
matrix_locations integer Early-exit after finding this many targets (TDMatrix only).
expansion_max_distance integer Maximum path distance in meters. Source-target pairs exceeding this are returned as unreachable.
date_time object
View JSON Schema on GitHub

JSON Schema

matrix-request.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/valhalla/main/json-schema/matrix-request.json",
  "title": "MatrixRequest",
  "description": "Request body for the Valhalla /sources_to_targets endpoint. Computes time and distance matrices between sets of origins and destinations.",
  "type": "object",
  "required": ["sources", "targets", "costing"],
  "properties": {
    "sources": {
      "type": "array",
      "minItems": 1,
      "description": "Origin locations.",
      "items": { "$ref": "location.json" }
    },
    "targets": {
      "type": "array",
      "minItems": 1,
      "description": "Destination locations.",
      "items": { "$ref": "location.json" }
    },
    "costing": {
      "type": "string",
      "enum": ["auto", "bicycle", "pedestrian", "truck", "bus", "taxi", "motor_scooter", "motorcycle", "multimodal", "bikeshare", "auto_pedestrian"],
      "description": "Travel mode costing model."
    },
    "costing_options": {
      "type": "object",
      "description": "Per-costing-model fine-tuning options."
    },
    "id": {
      "type": "string",
      "description": "Arbitrary request identifier echoed in the response."
    },
    "units": {
      "type": "string",
      "enum": ["km", "miles", "mi"],
      "default": "km"
    },
    "verbose": {
      "type": "boolean",
      "default": true,
      "description": "Include detailed per-cell metadata in the response."
    },
    "matrix_locations": {
      "type": "integer",
      "minimum": 1,
      "description": "Early-exit after finding this many targets (TDMatrix only)."
    },
    "expansion_max_distance": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000,
      "default": 0,
      "description": "Maximum path distance in meters. Source-target pairs exceeding this are returned as unreachable."
    },
    "date_time": {
      "type": "object",
      "properties": {
        "type": {
          "type": "integer",
          "enum": [0, 1, 2, 3]
        },
        "value": {
          "type": "string"
        }
      }
    }
  }
}