MatrixResponse

@Serializable
data class MatrixResponse(val durations: List<List<Double>>? = null, val distances: List<List<Double>>? = null, val sources: List<MatrixWaypoint>? = null, val destinations: List<MatrixWaypoint>? = null, val metadata: Metadata? = null)

Represents the response from an ORS Matrix API request.

The matrix response contains information about travel times or distances between a set of source and destination points.

Constructors

Link copied to clipboard
constructor(durations: List<List<Double>>? = null, distances: List<List<Double>>? = null, sources: List<MatrixWaypoint>? = null, destinations: List<MatrixWaypoint>? = null, metadata: Metadata? = null)

Properties

Link copied to clipboard

A list of enriched waypoint information for the destination locations. This is typically present when resolve_locations=true is used in the request, but might sometimes be included even if resolve_locations=false.

Link copied to clipboard
val distances: List<List<Double>>? = null

A list of lists representing the travel distance matrix. Present only if 'distances' was requested in the metrics parameter. The outer list corresponds to sources, and the inner list corresponds to destinations. Each value is the distance in meters.

Link copied to clipboard
val durations: List<List<Double>>? = null

A list of lists representing the travel duration matrix. Present only if 'durations' was requested in the metrics parameter. The outer list corresponds to sources, and the inner list corresponds to destinations. Each value is the duration in seconds.

Link copied to clipboard
val metadata: Metadata? = null

Standard ORS metadata including information about the service, engine, query, etc.

Link copied to clipboard

A list of enriched waypoint information for the source locations. This is typically present when resolve_locations=true is used in the request, but might sometimes be included even if resolve_locations=false.