Open Source Routing Machine
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
Location of the server.
Example: 10.15.162.7:5000
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
Service |
Description |
nearest |
returns the nearest street segment for a given coordinate |
route |
shortest path between given coordinates |
table |
computes duration tables for given coordinates |
match |
matches given coordinates to the road network |
trip |
compute the shortest round trip between given coordinates |
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
http://{server}/{service}/{version}/{profile}/{coordinates}[.{format}]?option=value&option=value
Option |
Values |
Description |
bearings |
{bearing};{bearing}[;{bearing} ...] |
Limits the search to segments with given bearing in degrees towards true north in clockwise direction. |
radiuses |
{radius};{radius}[;{radius} ...] |
Limits the search to given radius in meters. |
hints |
{hint};{hint}[;{hint} ...] |
Hint to derive position in street network. |
{ "code": {code}, "message": {message} }
Code |
Description |
Ok |
Request could be processed as expected. |
InvalidUrl |
URL string is invalid. |
InvalidService |
Service name is invalid. |
InvalidVersion |
Version is not found. |
InvalidOptions |
Options are invalid. |
NoSegment |
One of the supplied input coordinates could not snap to street. |
TooBig |
The request size violates one of the service specific request size restrictions. |
{ "code": {code}, "message": {message} }
*optional human-readable error message. (code Ok usually don’t come with any message)
Services
Snaps a coordinate to the street network and returns the nearest and matches
http://{server}/nearest/v1/{profile}/{coordinates}.json?{option}=value
single {longitude},{latitude}
number
code - if the request was successful: Ok ,otherwise see the service dependent and general status codes above.
waypoints - array of Waypoint objects sorted by distance to the input coordinate. Each object has at least the following additional properties:
Response:
Eg.
Get the shortest path between given coordinates
http://{server}/route/v1/{profile}/{coordinates}?{option}=value&{option}..
alternatives |
steps |
annotations |
geometries |
overview |
continue_straight |
code - if the request was successful: Ok ,otherwise see the service dependent and general status codes.
waypoints - Array of Waypoint objects representing all waypoints in order
routes - An array of Route objects, ordered by descending recommendation rank.
Response:
Eg.
Computes duration tables for given coordinates
http://{server}/table/v1/{profile}/{coordinates}?{option}=value&{option}..
code - if the request was successful: Ok ,otherwise see the service dependent and general status codes.
durations - array of arrays that stores the matrix in row-major order. Values are given in seconds.
sources - array of Waypoint objects describing all sources in order
destinations - array of Waypoint objects describing all destinations in order
Response:
Eg.
sources |
destinations |
Map matching matches given GPS points to the road network in the most plausible way
http://{server}/match/v1/{profile}/{coordinates}?{option}=value&{option}..
code - if the request was successful Ok otherwise see the service dependent and general status codes.
tracepoints - Array of Ẁaypoint objects representing all points of the trace in order. If the trace point was ommited by map matching because it is an outlier, the entry will be null. Each Waypoint object has the following additional properties:
matchings - An array of Route objects that assemble the trace. Each Route object has the following additional properties:
Response:
Eg.
steps |
geometries |
annotations |
overview |
timestamps |
radiuses |
Compute the shortest round trip between given coordinates
http://{server}/trip/v1/{profile}/{coordinates}?{option}=value&{option}..
code - if the request was successful Ok otherwise see the service dependent and general status codes.
waypoints - Array of Waypoint objects representing all waypoints in input order. Each Waypoint object has the following additional properties:
trips - An array of Route objects that assemble the trace.
Response:
Eg.
steps |
annotations |
geometries |
overview |
geometry: The unsimplified geometry of the route segment, depending on the geometries parameter.
name: The name of the way along which travel proceeds.
RouteStep Properties
{"intersections":
[{"out":0,"in":2,"entry":[true,true,false,false],"bearings":[0,90,180,270],"location":[101.662552,3.115442]},
{"out":0,"in":1,"entry":[true,false,false],"bearings":[0,180,210],"location":[101.662549,3.116177]},
{"out":0,"in":2,"entry":[true,false,false],"bearings":[30,120,210],"location":[101.662865,3.1173]},
{"out":1,"in":2,"entry":[true,true,false],"bearings":[15,45,225],"location":[101.663481,3.118112]},
{"out":0,"in":1,"entry":[true,false,false],"bearings":[90,270,330],"location":[101.664188,3.118541]},
{"out":1,"in":2,"entry":[true,true,false],"bearings":[75,120,285],"location":[101.665164,3.11837]}],
"geometry":"on_R}}nkRsC?w@?iAQ}Am@oCkBQMw@u@O]K[A]B{@\\eCBI",
"maneuver":
{"bearing_after":360,"bearing_before":357,
"location":[101.662552,3.115442],
"modifier":"straight","type":"turn"},
"mode":"driving",
"duration":37.6,
"name":"Jalan Pantai Baru",
"distance":537.6},
turn: a basic turn into direction of the modifier
new name: no turn is taken/possible, but the road name changes. The road can take a turn itself, following modifier.
depart: indicates the departure of the leg
arrive: indicates the destination of the leg
merge: merge onto a street
on ramp: take a ramp to enter a highway (direction given my modifier)
off ramp: take a ramp to exit a highway (direction given my modifier)
fork: take the left/right side at a fork depending on modifier
end of road: road ends in a T intersection turn in direction of modifier
continue: Turn in direction of modifier to stay on the same road
roundabout: traverse roundabout, has additional field exit with NR if the roundabout is left
rotary: a larger version of a roundabout, can offer rotary_name in addition to the exit parameter.
roundabout turn: Describes a turn at a small roundabout that should be treated as normal turn. The modifier indicates the turn direciton. Example instruction: At the roundabout turn left.
notification: not an actual turn but a change in the driving conditions. For example the travel mode. If the road takes a turn itself, the modifier describes the direction
uturn: indicates reversal of direction
sharp right: a sharp right turn
right: a normal turn to the right
slight right: a slight turn to the right
straight: no relevant change in direction
slight left: a slight turn to the left
left: a normal turn to the left
sharp left: a sharp turn to the left
{"intersections": [{"out":0,"in":2,"entry":[true,true,false,false],"bearings":[0,90,180,270],"location":[101.662552,3.115442]},
Please select the suitable service to use.
Trip
Nearest
Table
A
B
C
Match
D