action graphhopper_post_matrix { label: "POST Matrix Endpoint" description: "\nThe [GET endpoint](#operation/getMatrix) has an URL length limitation, which hurts for many locations per request.\nIn those cases use this POST endpoint with a JSON as input. The only parameter in the URL will be the key.\nBoth request scenarios are identical except that all singular parameter names are named as their plural for a POST request.\nThe effected parameters are: `points`, `from_points`, `to_points`, and `out_arrays`. For the remaining parameters\nplease refer to the [guide of the GET endpoint](#operation/getMatrix).\n\n**Please note that in contrast to GET endpoint the points have to be specified as `[longitude, latitude]` array (in that order, similar to [GeoJson](http://geojson.org/geojson-spec.html#examples))**.\n\nFor example the query `point=10,11&point=20,22&vehicle=car` will be converted to the following JSON:\n```json\n{ \"points\": [[11,10], [22,20]], \"vehicle\": \"car\" }\n```\n\nA complete curl Example:\n```bash\ncurl -X POST -H \"Content-Type: application/json\" \"https://graphhopper.com/api/1/matrix?key=[YOUR_KEY]\" -d '{\"elevation\":false,\"out_arrays\":[\"weights\", \"times\"],\"from_points\":[[-0.087891,51.534377],[-0.090637,51.467697],[-0.171833,51.521241],[-0.211487,51.473685]],\"to_points\":[[-0.087891,51.534377],[-0.090637,51.467697],[-0.171833,51.521241],[-0.211487,51.473685]],\"vehicle\":\"car\"}'\n```\n" provider: graphhopper method: POST path: "/matrix" encoding: json input: { type: "object" } output: { type: "object" properties: { distances: { type: "array" description: "The distance matrix for the specified points in the same order as the time matrix. The distances are in meters. If `fail_fast=false` the matrix will contain `null` for connections that could not be found." items: { type: "array" items: { type: "number" format: "int64" } } } hints: { type: "array" description: "Optional. Additional response data." items: { type: "object" properties: { details: { type: "string" description: "Details of this hint" } invalid_from_points: { type: "array" description: "Optional. An array of from_point indices of points that could not be found. Will only be added if `fail_fast=false` and some `from_point`s were not found.`" items: { type: "number" format: "int32" } } invalid_to_points: { type: "array" description: "Optional. An array of to_point indices of points that could not be found. Will only be added if `fail_fast=false` and some `to_point`s were not found.`" items: { type: "number" format: "int32" } } message: { type: "string" description: "Short description of this hint" } point_pairs: { type: "array" description: "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 `fail_fast=false` and some connections were not found." items: { type: "array" items: { type: "number" format: "int32" } } } } } } info: { type: "object" description: "Additional information for your request" properties: { copyrights: { type: "array" description: "Attribution according to our documentation is necessary if no white-label option included." items: { type: "string" } } took: { type: "number" format: "double" } } } times: { type: "array" description: "The time matrix for the specified points in the order [[from1->to1, from1->to2, ...], [from2->to1, from2->to2, ...], ...]. The times are in seconds. If `fail_fast=false` the matrix will contain `null` for connections that could not be found." items: { type: "array" items: { type: "number" format: "int64" } } } weights: { type: "array" description: "The weight matrix for the specified points in the same order as the time matrix. The weights for different vehicles 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 `fail_fast=false` the matrix will contain `null` for connections that could not be found." items: { type: "array" items: { type: "number" format: "double" } } } } } }