This web service calculates a route matrix for a series of points and returns a distance matrix. The distance and time computations are based on the actual road network.
{
"url": "https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/compactMatrix/v5.json",
"method": "POST",
"body":
{
"origins": [
{
"x": 6.961438,
"y": 50.932713
},
{
"x": 6.942641,
"y": 50.92259
}
],
"destinations": [
{
"x": 6.973438,
"y": 50.939732
},
{
"x": 7.106549,
"y": 50.879707
}
],
"srs": "WGS84",
"method": "time",
}
}
Input
| parameter | description | optional | default |
|---|---|---|---|
|
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
yes |
|
|
origins |
List of the coordinates for points of origin. Longitude and Latitude coordinates are separated by , characters. The pairs of coordinates are separated by the ";" character. |
yes |
|
|
destinations |
List of coordinates for destination points. Longitude and Latitude coordinates are separated by , characters. The pairs of coordinates are separated by the ";" character. |
yes |
|
|
method |
shortest route (distance) or fastest route (time) |
yes |
time |
|
exclusions |
List of restriction rules to use, separated by the ; character |
yes |
|
|
startDateTime |
Start date and time (format ISO8601: local time) Example: 2014-01-21T09:00:00.000+01:00 (or 2014-01-21T09:00:00.000%2B01:00) for a departure on 21 January 2014, at 9h in Paris |
yes |
|
|
snapMethod |
Snap to graph method |
yes |
standard |
|
avoidArea |
Forbidden transit zone in WKT format (POLYGON or MULTIPOLYGON) in the projection (srs parameter) requested |
yes |
|
|
maxTargets |
Stops calculating routes on each line when maxTargets routes have already been calculated (results in a partially calculated matrix, but with at least the first column filled) |
yes |
no limit |
|
configName |
Name of the configuration to use: |
yes |
|
|
computeOptions |
Selection of variables to use in calculations, using semi-colons ; as separators: |
yes |
Output
Matrix (compactMatrixResult)
| parameter | type | min/max | description |
|---|---|---|---|
|
distanceMeters |
Bi-dimensional Array of double |
0/unlimited |
Distance matrix result (in meters) |
|
durationSeconds |
Bi-dimensional Array of double |
0/unlimited |
Time matrix result (in seconds) |
Case of a found itinerary (compactMatrixResult/status is OK)
{
"message": null,
"status": "OK",
"distanceMeters": [
[
2120,
14178
],
[
3702,
15231
]
],
"durationSeconds": [
[
333,
1015
],
[
559,
1182
]
]
}
Case of a forgotten origin or destination specification tool (compactMatrixResult/status is ERROR)
{
"message": "Origins must be not empty",
"status": "ERROR"
}
Case of a faulty type (serviceResult/status is ERROR)
{
"message":"NumberFormatException: For input string: \"sdfkl\"",
"status":"ERROR"
}
Case of a snap to graph error (compactMatrixResult/status is OK) / (cell/status is KO)
{
"message": null,
"status": "OK",
"distanceMeters": [
[
2120,
14178
],
[
-1,
-1
]
],
"durationSeconds": [
[
333,
1015
],
[
-1,
-1
]
]
}
- 1. How can I perform a toll-free route matrix calculation?
- 2. What are the maximum values allowed by predefined configName?
- 3. What are the exclusions available?
- 4. What are the Hazardous material exclusions?
- 5. What are Speed Patterns? How are they used?
- 6. How do you use heavy goods vehicle attributes?

