# Compute a matrix For N origins and M destinations, compute routes from all origins to all destinations and output the result as a matrix of travel times and/or distances. This includes the common cases of routes from one origin to many destinations, or from many origins to one destination. Endpoint: GET /matrix Version: 1.0.0 Security: api_key ## Query parameters: - `profile` (string) The routing profile. It determines the network, speed and other physical attributes used when computing the route. See the section about routing profiles for more details and valid profile values. - `point` (array) Specify multiple points in for which the weight-, route-, time- or distance-matrix should be calculated. In this case the starts are identical to the destinations. If there are N points, then NxN entries will be calculated. The order of the point parameter is important. Specify at least three points. Cannot be used together with from_point or to_point. - `from_point` (array) The origin points for the routes in . E.g. if you want to calculate the three routes A->1, A->2, A->3 then you have one from_point parameter and three to_point parameters. - `to_point` (array) The destination points for the routes in . - `point_hint` (array) Optional parameter. Specifies a hint for each parameter to prefer a certain street for the closest location lookup. E.g. if there is an address or house with two or more neighboring streets you can control for which street the closest location is looked up. - `from_point_hint` (array) For the from_point parameter. See point_hint - `to_point_hint` (array) For the to_point parameter. See point_hint - `snap_prevention` (array) Optional parameter. 'Snapping' is the process of finding the closest road location for GPS coordinates provided in the parameter. The parameter allows you to prevent snapping to specific types of roads. For example, if is set to bridge, the routing engine will avoid snapping to a bridge, even if it is the closest road for the given . Current supported values: , , , , and . Multiple values are specified like . Note that once snapped the routing algorithm can still route over bridges (or the other values). To avoid this you need to use the . - `curbside` (array) Optional parameter. It specifies on which side a point should be relative to the driver when she leaves/arrives at a start/target/via point. You need to specify this parameter for either none or all points. Only supported for motor vehicles and OpenStreetMap. Enum: "any", "right", "left" - `from_curbside` (array) Curbside setting for the from_point parameter. See curbside. Enum: "any", "right", "left" - `to_curbside` (array) Curbside setting for the to_point parameter. See curbside. Enum: "any", "right", "left" - `out_array` (array) Specifies which arrays should be included in the response. Specify one or more of the following options 'weights', 'times', 'distances'. To specify more than one array use e.g. out_array=times&out_array=distances. The units of the entries of distances are meters, of times are seconds and of weights is arbitrary and it can differ for different vehicles or versions of this API. - `fail_fast` (boolean) Specifies whether or not the matrix calculation should return with an error as soon as possible in case some points cannot be found or some points are not connected. If set to the time/weight/distance matrix will be calculated for all valid points and contain the value for all entries that could not be calculated. The field of the response will also contain additional information about what went wrong (see its documentation). ## Response 200 fields (application/json): - `distances` (array) The distance matrix for the specified points in the same order as the time matrix. The distances are in meters. If the matrix will contain for connections that could not be found. Example: [[0,97653,48887],[97426,0,121035],[49006,121049,0]] - `times` (array) The time matrix for the specified points in the order [[from1->to1, from1->to2, ...], [from2->to1, from2->to2, ...], ...]. The times are in seconds. If the matrix will contain for connections that could not be found. Example: [[0,4197,2994],[4192,0,6074],[3006,6062,0]] - `weights` (array) The weight matrix for the specified points in the same order as the time matrix. The weights for different vehicle profiles can have a different unit but the weights array is perfectly suited as input for Vehicle Routing Problems as it is currently faster to calculate. If the matrix will contain for connections that could not be found. Example: [[0,5662.551,3727.147],[5653.807,0,7889.653],[3741.528,7878.365,0]] - `info` (object) Additional information for your request Example: {"copyrights":["GraphHopper","OpenStreetMap contributors"]} - `info.copyrights` (array) Attribution according to our documentation is necessary if no white-label option included. Example: ["GraphHopper","OpenStreetMap contributors"] - `info.took` (number) - `hints` (array) Optional. Additional response data. - `hints.message` (string) Short description of this hint - `hints.details` (string) Details of this hint - `hints.invalid_from_points` (array) Optional. An array of from_point indices of points that could not be found. Will only be added if and some s were not found.` - `hints.invalid_to_points` (array) Optional. An array of to_point indices of points that could not be found. Will only be added if and some s were not found.` - `hints.point_pairs` (array) Optional. An array of two-element arrays representing the from/to_point indices of points for which no connection could be found. Will only be added if and some connections were not found.