Google Distance Matrix

This node uses the Google Distance Matrix API to create a distance matrix for the provided origins and destinations. The matrix is created by pairing each input origin with each input destination and will contain the travel distance and duration for each pair. The distance unit is meter and the duration is returned in minutes.

If the input geometry is not a point geometry, the centroids will be automatically computed and used.

Options

Origin geometry column

Select the geometry column that describes the origins.

Origin ID column

Select the column which contains for each origin a unique ID. The selected column will be returned in the result table and can be used to link back to the original data.

Destination geometry column

Select the geometry column that describes the destinations.

Destination ID column

Select the column which contains for each destination a unique ID. The selected column will be returned in the result table and can be used to link back to the original data.

Google API key

Click here for details on how to obtain and use a Google API key for the Distance Matrix API.

Travel mode

The following travel modes are supported:

Available options:

  • Bicycling: Requests bicycling directions or distance via bicycle paths & preferred streets (where available). Bicycling directions may sometimes not include clear bicycling paths.
  • Driving: Indicates standard driving directions or distance using the road network.
  • Transit: Requests directions or distance via public transit routes (where available). The used departure time is now.
  • Walking: Requests walking directions or distance via pedestrian paths & sidewalks (where available). Walking directions may sometimes not include clear pedestrian paths.
Consider traffic

If checked, the travel time and distance will be computed considering the traffic conditions. If unchecked, the travel time and distance will be computed without considering the traffic conditions.

Traffic model

The traffic model specifies the assumptions to use when calculating time in traffic.

Available options:

  • Best guess: Indicates that the returned duration in traffic should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer the departure time is to now.
  • Pessimistic: Indicates that the returned duration in traffic should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value.
  • Optimistic: Indicates that the returned duration in traffic should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value.
Departure time

The departure time may be specified in two cases: - For requests where the travel mode is transit: You can optionally specify departure_time or arrival_time. If None the departure_time defaults to now (that is, the departure time defaults to the current time). - For requests where the travel mode is driving: You can specify the departure_time to receive a route and trip duration (response field: duration_in_traffic) that take traffic conditions into account. The departure_time must be set to the current time or some time in the future. It cannot be in the past.

Note: If departure time is not specified, choice of route and duration are based on road network and average time-independent traffic conditions. Results for a given request may vary over time due to changes in the road network, updated average traffic conditions, and the distributed nature of the service. Results may also vary between nearly-equivalent routes at any time or frequency.

Input Ports

Icon

Input table with origin geometry and ID column.

Icon

Input table with destination geometry and ID column.

Output Ports

Icon

Output table with the selected origin and destination ID columns and the corresponding travel costs in minutes and meters.

Popular Predecessors

  • No recommendations found

Popular Successors

  • No recommendations found

Views

This node has no views

Workflows

  • No workflows found

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.