Maplab
  • About
  • API reference
    • Geocoder
      • Search
      • AutoComplete
      • Reverse
    • Optimization
      • Vehicle Routing Optimization
    • Router
      • Directions
      • Isochrones
      • Matrix
  • Specification
Powered by GitBook
On this page

Was this helpful?

  1. API reference
  2. Router

Matrix

PreviousIsochrones

Was this helpful?

Get a matrix of distances and durations between multiple locations.

post
Body
destinationsinteger · int32[] | nullableOptional

The indices represent the position of the locations in the list. For example, if you have a list of five locations, and you want to specify the first and fourth locations as destinations, you would use the indices [0,3]. By default, all locations are set as destinations. This allows you to specify which locations in your list should be treated as destinations in the matrix calculation.

sourcesinteger · int32[] | nullableOptional

the Source parameter can take a list of indices that refer to the list of locations. The indices represent the position of the locations in the list. For example, if you have a list of five locations and you want to specify the first and fourth locations as sources, you would use the indices [0,3]. By default, all locations are set as sources. This allows you to specify which locations in your list should be treated as sources in the matrix calculation.

idstring | nullableOptional

An aritrary identifier for this request. It will be returned in the response.

resolveLocationsbooleanOptional

Specifies whether given locations are resolved or not. If the parameter value set to true, every element in destinations and sources will contain a name element that identifies the name of the closest street. Default is false.

profilestring | nullableOptional
Responses
200
Success
post
POST /v1/Router/Matrix HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 184

{
  "locations": [
    [
      8.681495,
      49.41461
    ],
    [
      8.686507,
      49.41943
    ],
    [
      8.687872,
      49.42032
    ]
  ],
  "destinations": [
    1
  ],
  "sources": [
    1
  ],
  "id": "text",
  "metrics": [
    "Duration"
  ],
  "resolveLocations": true,
  "profile": "text"
}
200

Success

No content