GetRouteRequestRPC
Get route plan between two points.
Description
Request forwards route parameters to the request handler. Parameters include coordinates of two points, coordinate system and other optional route parameters.
Parameters
(* means the parameter is required)
Name | Type | Description | Default value |
---|---|---|---|
/* SRS | String | Coordinate system of the route coordinates, for example EPSG:3067 | |
/* fromlat | Number | y coordinate of the starting point | |
/* fromlon | Number | x coordinate of the starting point | |
/* tolat | Number | y coordinate of the arrival point | |
/* tolon | Number | x coordinate of the arrival point | |
date | Number | Date for route plan | |
time | Number | Time for route plan | |
mode | String, String, .. | Routing vechiles | |
arriveby | Boolean | Is the time to the destination | false |
maxwalkdistance | Number | Max walk distance to nearest stop | 1000 m |
wheelchair | Boolean | Wheelchair passanger | false |
lang | String | the language in which to get instructions | |
showIntermediateStops | Boolean | Intermediate stops are included in the response | false |
Parameter description
http://dev.opentripplanner.org/apidoc/0.15.0/resource_PlannerResource.html
Allowed parameter values http://dev.opentripplanner.org/apidoc/0.15.0/model.html / Data Types
Oskari request parameter defaults
There are also parameters, which are not in request api, but are defined in OPT server and Oskari server configs
Oskari server configs
routing.user = USER
routing.password = PASSWORD
routing.srs = EPSG:4326
routing.url = http://beta.digitransit.fi/otp/routers/finland/plan?
routing.default.maxwalkdistance = 1000
routing.default.mode = TRANSIT,WALK
routing.forceXY = false
Examples
Get route insctructions between two points:
var sb = Oskari.getSandbox();
sb.postRequestByName('GetRouteRequest', [{
fromlat: "6733840",
fromlon: "360448",
srs: "EPSG:3067",
tolat: "6675728",
tolon: "394240"
}]);
Related api
- RouteResultEvent