The Cluster endpoint is used with a POST request towards
https://graphhopper.com/api/1/cluster?key=<your_key>. The solution will be provided in the JSON response.
Please note that for problems that take longer than 10 seconds a bad request error is returned.
In this case please use the asynchronous instead.
643 matches
10 actions
GraphHopper Directions
10 actions
Other/GraphHopper Directions
POST Cluster Endpoint
v1.0.0Input
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
{
"type": "object",
"properties": {
"configuration": {
"type": "object",
"properties": {
"clustering": {
"type": "object",
"properties": {
"max_quantity": {
"type": "number",
"format": "int32",
"description": "Specifies max. quantity in a cluster"
},
"min_quantity": {
"type": "number",
"format": "int32",
"description": "Specifies min. quantity in a cluster"
},
"num_clusters": {
"type": "number",
"format": "int32",
"description": "Specifies the number of clusters"
}
}
},
"response_type": {
"type": "string",
"description": "Specifies the response format. You can either choose `geojson` or `json`."
},
"routing": {
"type": "object",
"properties": {
"cost_per_meter": {
"type": "number",
"format": "double",
"description": "Cost per meter (travel distance)"
},
"cost_per_second": {
"type": "number",
"format": "double",
"description": "Cost per second (travel time)"
},
"profile": {
"type": "string",
"description": "The routing profile for which the travel times and distances should be calculated. Other profiles are listed [here](#section/Map-Data-and-Routing-Profiles/OpenStreetMap)"
}
}
}
}
},
"customers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {
"type": "object",
"properties": {
"lat": {
"type": "number",
"format": "double",
"description": "Latitude"
},
"lon": {
"type": "number",
"format": "double",
"description": "Longitude"
},
"street_hint": {
"type": "string",
"description": "Optional parameter. Specifies a hint for each address to better snap the coordinates (lon,lat) to road network. 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."
}
}
},
"id": {
"type": "string",
"description": "id of customer"
},
"quantity": {
"type": "number",
"format": "int32",
"description": "demand of customer"
}
}
}
}
}
}Output
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
{
"type": "object",
"properties": {
"clusters": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"description": "Array of customer ids assigned to this specific cluster",
"items": {
"type": "string"
}
},
"quantity": {
"type": "number",
"format": "int32",
"description": "Cluster size"
}
}
}
},
"copyrights": {
"type": "array",
"items": {
"type": "string"
}
},
"processing_time": {
"type": "number",
"format": "double"
},
"status": {
"type": "string",
"description": "Indicates the current status of the job",
"enum": [
"waiting_in_queue",
"processing",
"finished"
]
},
"waiting_time_in_queue": {
"type": "number",
"format": "double"
}
}
}