The HTTP API is implemented over a REST scheme where HTTP GET requests return JSON objects. The general URL scheme is:
http://{host}/{service}?{param}={value}
Where service can be either nearest
for the Nearest service to snap coordinates to nodes, or route
for the actual Route service.
Returns the ID and coordinate of the nearest node in the road network.
param | value |
---|---|
lon |
Longitude of the coordinate |
lat |
Latitude of the coordinate |
http://{host}/nearest?lon=8.419845700263977&lat=49.014124567148194
id
: Integer that contains the node IDcoordiante
: Array of two floating point values that represent the snapped coordinates in[{lon}, {lat}]
encoding.
{"id": 1, "coordinate": [8.419845700263977, 49.014124567148194]}
Return the fastest route of an electric vehicle between two nodes using a specific algorithm.
param | value |
---|---|
start |
Node ID of the start |
target |
Node ID of the target |
algorithm |
One of fpc_dijkstra , bi_fastest_dijkstra , mcc_dijkstra , fp_dijkstra , mc_dijkstra |
search\_space |
http://{host}/route?start=1&target=2&algorithm=fpc_dijkstra
start
: Integer that encodes the node ID of the starttarget
: Integer that encodes the node ID of the targetroutes
: Array ofRoute
objects.
path
: Array of node ids that make up the route.durations
: Array of durations values insec
for every point on the path (accumulative).consumptions
: Array of consumption values inWh
for every point on the path (accumulative).lengths
: Array of distance values inmeter
for every point on the path (accumulative).heights
: Array of height values inmeter
for every point on the path.max_speeds
: Array of maximum speed values inkm/h
for every segment.max_speeds[i]
corresponds to the segmentpath[i-1], path[i]
. The first values is always 0.geometry
: Array of coordinates encodes as arrays in[{lon}, {lat}]
order.search_space
: (optional) GeoJSON feature collection of the search space of the algorithm.tradeoff
: Array ofTradeoff
objects that represent sub-functions of the optimal time-consumption trade-off function
Encodes parameters for the formula: a/(x-b)^2 + c + d * (x - b)
, where x
is the duration and the result the consumption in Wh
.
min_duration
: Minimal travel time insec
.max_duration
: Maximal travel time insec
.a
: Floating number indicating the first parameter of the hyperbolic functionb
: Floating number indicating the second parameter of the hyperbolic functionc
: Floating number indicating the third parameter of the hyperbolic functiond
: Floating number indicating the fourth parameter of the hyperbolic function