Distance Matrix
DistanceMatrixConfig — distance/duration matrix data source.
- class DistanceMatrixConfig(from_sheet_name, from_longitude_column, from_latitude_column, outputs)[source]
Computes a matrix of distances/durations between origin and destination points.
Configure destinations via
set_to_sheet(). By default the destination sheet is the same as the origin sheet (square matrix). Each entry inoutputsdefines where one metric is written.- Parameters:
from_sheet_name (
str) – Source sheet for origin rows.from_longitude_column (
str) – Origin-row longitude column name.from_latitude_column (
str) – Origin-row latitude column name.outputs (
list[OutputMatrix]) – OneOutputMatrixper metric to produce.
- set_to_sheet(to_sheet_name, to_longitude_column, to_latitude_column)[source]
Set the destination sheet name and longitude/latitude columns.
- Return type:
- set_from_table_name(from_table_name)[source]
Set the structured-table name for origin rows (alternative to a sheet name).
- Return type:
- set_to_table_name(to_table_name)[source]
Set the structured-table name for destination rows.
- Return type:
- property type: DataSourceType
The
DataSourceTypediscriminator for this configuration.
OutputMatrix and Metric for DistanceMatrixConfig outputs.
- class Metric(*values)[source]
Distance-matrix output metric.
- DRIVING_DISTANCE = 'DRIVING_DISTANCE'
Driving distance along the route.
- DRIVING_TIME = 'DRIVING_TIME'
Driving time along the route.