This web service calculates an itinerary between two points and returns a full route sheet. It is possible to add optional intermediate steps.
{ "url":"https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/route/v7.json", "type":"GET", "params": { "origin": { "sample":"5.3655,43.3293" }, "destination": { "sample":"5.3940,43.2673" }, "waypoints": { "sample":"" }, "exclusions": { "sample":"ZFE" } } }
parameter | description | optional | default |
---|---|---|---|
origin |
Coordinates of the start point (longitude, latitude). |
no |
|
destination |
Coordinates of the end point (longitude,latitude). |
no |
|
waypoints |
List of the coordinates of the route stops. The longitude and latitude coordinates are separated by the "," character. The pairs of coordinates are separated from each other by the ";" character. |
yes |
|
method |
Method to compute the route between the start point and the resources: |
yes |
time |
format |
- standard: result = route summary / bounds / geometry in wkt format / simplified geometry in wkt format / list of concatenated
segments (without geometries) |
yes |
standard |
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
yes |
|
tolerance |
Tolerance distance (in meters) for the geometry simplification. |
yes |
|
originDateTime |
Origin date and time (format ISO8601: local time) example: 2014-01-21T09:00:00.000+0100 (or 2014-01-21T09:00:00.000%2B01:00) for a start on 21 January 2014, at 9.00am in Paris |
yes |
|
destinationDateTime |
Destination date and time (format ISO8601: local time) example: 2014-01-21T09:00:00.000+0100 (or 2014-01-21T09:00:00.000%2B01:00) for a departure on 21 January 2014, at 9.00am in Paris |
yes |
|
exclusions |
List of restriction rules to use, separated by the ; character |
yes |
|
timeLine |
List of intermediate durations to calculate positions along the route trajectory. Expressed in seconds, separated by the ; character. The returned position corresponds to the previous node, on the route, connectable to the network. For example, on a highway, the position returned is the last exit or service area before the requested position. |
yes |
|
snapMethod |
Snap to graph method |
yes |
standard |
avoidArea |
Forbidden transit zone in WKT format (POLYGON or MULTIPOLYGON) in the requested projection (srs parameter) |
yes |
|
configName |
Name of the configuration to use: |
yes |
|
computeOptions |
Selection of variables to use in calculations, using semi-colons ; as separators: |
yes |
|
formatItems |
List of format items to use, if route format is set to custom |
oui |
|
fields |
list of fields to retrieve value for each leg (for standard and extended formats ) |
oui |
Route (routeResult)
parameter | type | min/max | description |
---|---|---|---|
distance |
string |
0/1 |
Total route distance, formatted: |
duration |
string |
0/1 |
Total duration of the route, formatted: |
distanceMeters |
double |
0/1 |
Total route distance in meters. |
durationSeconds |
double |
0/1 |
Total duration of the route in seconds. |
bounds |
double |
0/1 |
Bounds of the result route geometry. |
wktGeometry |
string |
0/1 |
Geometry of the route in WKT format |
wktSimplified |
string |
0/1 |
Simplified geometry in WKT format. |
legs |
Array of SubRouteV7 |
0/unlimited |
List of route segments. |
startDateTime |
string |
0/1 |
Start date and time (format: ISO8601 without any area code: local time) |
finishDateTime |
string |
0/1 |
Arrival date and time (format: ISO8601 without any area code: local time) |
timeLine |
Array of TimeLineItemV7 |
0/unlimited |
List of calculated positions. |
srs |
string |
0/1 |
projection passed as input (EPSG code such as epsg:4326 or wgs84) |
originNode |
string |
0/1 |
Start node identifier (entered if format=NODE). |
destinationNode |
string |
0/1 |
Arrival node identifier (entered if format=NODE). |
waypointNodes |
waypointNodes array (string) |
0/unlimited |
Step nodes identifiers (entered if format=node). |
carbonFootprint |
double |
0/1 |
Carbon footprint (CO2 emissions in kilograms). |
energyConsumption |
double |
0/1 |
Energy consumption (Energy consumed in Litres or kWh for electrical vehicles). |
tollCost |
Array of tollCost |
0/unlimited |
Toll cost informations (entered if format=TOLLCOST). |
fieldsNames |
Array of string |
0/unlimited |
value of fields. |
Itinerary portion (SubRouteV7)
parameter | type | min/max | description |
---|---|---|---|
distance |
string |
0/1 |
Total route distance, formatted: |
duration |
string |
0/1 |
Total duration of the route, formatted: |
distanceMeters |
double |
0/1 |
Distance covered by the route segment in meters. |
durationSeconds |
double |
0/1 |
Duration of the route segment in seconds. |
steps |
Array of SegmentV7 |
0/unlimited |
List of component segments in the route segments |
Route segment (SegmentV7)
parameter | type | min/max | description |
---|---|---|---|
distance |
string |
0/1 |
Total route distance, formatted: |
duration |
string |
0/1 |
Total duration of the route, formatted: |
distanceMeters |
double |
0/1 |
Distance covered by the route segment in meters. |
durationSeconds |
double |
0/1 |
Duration of the route segment in seconds. |
navigationInstruction |
string |
0/1 |
Navigation instruction code: |
name |
string |
0/1 |
Segment street name. |
points |
string |
0/unlimited |
List of coordinates separated by the , character |
fieldsNames |
Array of string |
0/unlimited |
value of fields. |
Route position (TimeLineItemV7)
parameter | type | min/max | description |
---|---|---|---|
durationSeconds |
double |
0/1 |
Route duration in seconds up to this position. |
message |
string |
0/1 |
Error message for this position. |
status |
string |
0/1 |
Status of this position. |
distanceMeters |
double |
0/1 |
Distance of the route in meters up to this position. |
location |
string |
0/1 |
Coordinates of the position. |
Toll Cost (tollCost)
parameter | type | min/max | description |
---|---|---|---|
amount |
double |
0/1 |
Total cost of tolls . |
currency |
string |
0/1 |
Currency. |
costsByCountry |
Array of costsByCountry |
0/unlimited |
List of toll cost by countries. |
Cost by countries (costsByCountry)
parameter | type | min/max | description |
---|---|---|---|
amount |
double |
0/1 |
Cost of tolls. |
country |
string |
0/1 |
Country code (3-letter ISO country codes). |
Case of a route found (routeResult/status is OK)
{ "status": "OK", "distance": "5.23 Km", "duration": "0:22:24", "distanceMeters": 5229.86, "durationSeconds": 1344.15, "bounds": "-0.167612,51.48793;-0.125122,51.50068", "wktGeometry": "LINESTRING (-0.125122 51.494445, -0.125159 51.494452, -0.12519 51.49439, -0.12517 51.49399, [...])", "wktSimplifiedGeometry": "LINESTRING (-0.125122 51.494445, -0.125159 51.494452, -0.12519 51.49439, -0.12517 51.49399, [...])", "carbonFootprint": 2.493, "energyConsumption": 0.266, "computationTime": 3669.643, "legs": [ { "distance": "3.37 Km", "duration": "0:14:26", "distanceMeters": 3374.55, "durationSeconds": 866.17, "steps": [ { "distance": "54 m", "duration": "0:00:15", "distanceMeters": 54.45, "durationSeconds": 15.72, "name": "MILLBANK" }, [...] ] }, { "distance": "1.86 Km", "duration": "0:07:57", "distanceMeters": 1855.31, "durationSeconds": 477.98, "steps": [ { "distance": "11 m", "duration": "0:00:03", "distanceMeters": 11.07, "durationSeconds": 3.16, "name": "BASIL STREET" }, [...] ] } ] }
Case of a forgotten specification of a start or finish point (routeResult/status is ERROR)
{ "message": "Origin, destination and waypoints should be represented by a couple of coordinates", "status": "ERROR", "legs": [ ] }
Case of a faulty format assigned to the start or finish point or to route stops (routeResult/status is ERROR)
{ "message": "Origin, destination and waypoints should be represented by a couple of coordinates", "status": "ERROR", "legs": [ ] }
Case of a snap-to-graph error (serviceResult/status is ERROR)
{ "message": "ServiceException: Error in route computation|Error in smartrouting|Failed to execute calculateRoute|com.geoconcept.smartrouting.SmartRoutingNativeException: failed to connect waypoint { -100.125122, 51.494445, 0.000000 } srs=epsg:4326|failed to connect waypoint { -100.125122, 51.494445, 0.000000 } srs=epsg:4326", "status": "ERROR" }
- 1. Is it possible to give priority to either journey time or journey distance?
- 2. Is it important what order the points are in?
- 3. How perform a route calculation without including any road tolls?
- 4. What are the maximum values allowed by predefined configName?
- 5. What are the exclusions available?
- 6. What are the Hazardous material exclusions?
- 7. What are Speed Patterns? How are they used?
- 8. How do you use heavy goods vehicle attributes?
- 9. How is the carbon footprint for a journey calculated?
- 10. What is the algorithm used for compressedgeometry and compressedsimplifiedgeometry formats?
1. |
Is it possible to give priority to either journey time or journey distance? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Yes, by changing the method: distance or time. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2. |
Is it important what order the points are in? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The points, whether they are start points, finish points, or way points are read and used in that order. The first point declared is considered as a start point, the second as an arrival point, and the others as way points. The order of the points is therefore very important. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3. |
How perform a route calculation without including any road tolls? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Place the exclusion Toll in |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4. |
What are the maximum values allowed by predefined configName? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See list below:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5. |
What are the exclusions available? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See list below:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6. |
What are the Hazardous material exclusions? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hazardous material defines a restriction to a road for any vehicle carrying the specific hazardous material. Hazardous material restrictions are government regulations and can be different per country.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7. |
What are Speed Patterns? How are they used? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
With the aim of suggesting journey times that take traffic conditions into account as accurately as possible, cars and trucks have 5 speed profiles (Speed Patterns) so various levels of road congestion can be taken into account over the timespan of a whole day:
To use these, you will need to pass to parameter, when calling the web service, the following parameter &computeOptions=speedPattern:fast-speed&configName=car |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8. |
How do you use heavy goods vehicle attributes? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You need to calculate an itinerary using either a vehicle configName using the restrictions, or by overwriting the
call to the web service using the parameter &computeOptions=height:450 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9. |
How is the carbon footprint for a journey calculated? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Calculation of carbon footprint takes into account vehicle type, fuel type, and vehicle speed, road section by road section:
10 kms in a town context does not have the same carbon footprint as 10km in the countryside. It is displayed in the response
when format is equal to standard (default) or extended.
averageConsumption allows you to indicate the average consumption for the vehicle for 100 kilometers. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10. |
What is the algorithm used for compressedgeometry and compressedsimplifiedgeometry formats? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The utilization of the encoded polyline compression algorithm (Encoded Polyline Algorithm Format) enabling storage of coordinates in a single ASCII character string, thereby significantly reducing overall data volumes. |