Geospatial · Geocoding and routing

Matrix

Works out road distance and travel time between every pair of points, or from each start to each destination. For example, drive time from every store to every customer.

Also known as: Distance matrix, origin–destination

How it works

Pick the Latitude and Longitude columns, a Travel mode (Car by default, or Bike, Walk or Truck) and the Routing tiles. With only the first input wired the node routes every pair of points in that table. Wire a second table into the destinations input for an origins-to-destinations matrix; the same column names are read from both. An optional Label column carries each point's name into the result.

The output is long-form, one row per pair: origin_index, destination_index, origin_lat, origin_lon, destination_lat, destination_lon, origin_label and destination_label when a Label column is set, route_distance_m and route_duration_s. Both endpoints ride each row, so the result plots without joining back to the points.

Inputs and outputs

Inputs

  • origins — Table
  • destinations — Table

Outputs

  • data — Table

Settings

The Attributes panel of Matrix, as in the app: the controls work, but nothing runs — there is no data behind it.

The same settings, as the Assistant writes them
{
  lat: string
  lon: string
  labelColumn?: string
  costing: "auto"|"bicycle"|"pedestrian"|"truck"
}

lat/lon are the point columns. Long-form output (origin_index, destination_index, origin_lat, origin_lon, destination_lat, destination_lon, route_distance_m, route_duration_s) — both endpoints ride each cell, so an OD result plots without joining back to the points. Wire the second (destinations) input for a distinct m×n matrix. Never emit tile-set ids or paths — the app selects the installed tile set itself.

Example

You want the drive time from each of 10 stores to each of 200 customers; the node stops with an error above 2,500 pairs. Wire stores into the first input and customers into the second, set Label column to a name column both tables have (labels are only written when both tables have it), then Top N by route_duration_s per customer to find the nearest store.