We took what we learned from using the excellent Graph Hopper open source library and built a new, open-source route planner from scratch. Future enhancements will focus on time-dependent routing and commercial vehicle routing. We still use the open-source Jsprit library for route optimization.
You must be a B.C. Government Ministry to use this API.
You will need an apikey header in your requests. To acquire an API key, submit a request using the API Services Portal.
To see the new API in action, visit Location Services in Action. Feel free to monitor network traffic in your browser to see the new route planner requests.
Route Planner 2.1 is backward compatible with Route Planner 2.x.
Enable intersection crossing costs (xc) to more accurately model all combinations of major and minor road crossings.
Enable the global distortion field (gdf) to allow the router to prefer major roads over minor ones. Global distortion fields (gdf) only affect truck routing (e.g. requests that specify the /truck resource).
Enable local distortion fields (ldf) to steer trucks away from particular roads or truck routes. Local distortion fields (ldf) only affect truck routing (e.g., requests that specify the /truck resource). Local distortion fields are defined by road authorities.
Use the enable parameter to turn on optional features including honouring route start time, turn restrictions (tr), turn costs (tc), intersection crossing costs (xc), global distortion fields (gdf) and local distortion fields (ldf), ferry schedules (sc) (only suitable for demos), historic traffic congestion (tf) (only suitable for demos), and road events (ev) (only suitable for demos).
The disable parameter is now deprecated. Use the enable parameter instead.
Use the partition parameter to partition the best route by truck/non-truck segments, ferry/non-ferry segments, and locality. The partitions are returned in a separate partitions parameter; the route output parameter is unchanged. Partitions give your application enough information to treat truck route portions of a route differently than non-truck route portions (e.g., different styles). Same for ferry segments. Locality partitioning gives your application a complete list of municipalities traversed by the best route which is useful in determining appropriate truck bylaws for example.
One-way weight restrictions are now supported. This is necessary to prevent heavy trucks from turning onto a road with a steep downward grade.
Route directions now include (notifications for oversize commercial vehicles (in the Greater Vancouver area))
Route Planner 2.0 is backward compatible with Route Planner 1.x .
Use the new departure parameter to specify departure date and time as in 2019-02-28T11:36:00-08:00
Use the new correctSide parameter to specify if origin and destination should begin and end on the correct side of the street. For example, 1175 Douglas St, Victoria, BC is on the east side of Douglas St. To start or end on this side of the street, set correctSide to True.
You can specify truck dimensions with the height (OAH in metres), width (OAW in metres), and weight (GVW in kg) parameters. (only suitable for demos)</b>
For more information about the API, consult the Route Planner Developer Guide
Feature | Enabled by Default |
Feature Quality | Data Needed | Data Quality |
---|---|---|---|---|
Correct-side routing | No | Good | Road geometry from ITN and address ranges from BC Address Geocoder | Excellent |
Hard road restrictions | Yes | Acceptable; basic minimum height and weight restrictions (including directional weight restrictions) are supported; | road minimum height and weight from ITN | height and weight: Acceptable in Metro Vancouver, poor elsewhere width and length: minimal data in ITN. (only suitable for demos) |
Time-dependent turn-restrictions | No | Functionally good but demo only due to poor data | Time-dependent turn restrictions from ITN | Poor. There are many missing time-dependent turn-restrictions in the data. |
Time independent turn restrictions | Yes | Supports restrictions on U-Turns,left-turns, right-turns, and straight-throughs. | Implicit restrictions Explicit restrictions from ITN (e.g., based on observed road signs) |
Implicit restrictions: high Explicit restrictions: Good in Metropolitan Vancouver area. Poor everywhere else |
Start time | No | Good | All time-dependent data | Variable |
Truck routes | Yes | Good; Only supports a basic truck route, not weight or height corridors, hazardous material routes, or evacuation routes | Truck routes from ITN | Good in Metropolitan Vancouver area, all highways in province are truck routes but no local truck routes outside Metro Vancouver |
Turn costs | Yes | Acceptable | Turn cost estimates by turn type (left,right,straight) traffic impactor (yield, stop, light) intersection approach/departure (slowing down,speeding up) |
Acceptable, turn-costs have been coarsely-tuned. |
Ferry schedules | No | Good | GTFS files from BC Ferries and Ministry of Transportation | BC Ferries doesn’t provide GTFS so we created a static GTFS file. Added support for Barnston Island Ferry (MOTI) and you don’t need to enable ferry schedules to route over it because it is unscheduled. (only suitable for demos) |
Historic traffic congestion | No | Demo data only | historic traffic data for each road segment in urban areas | Poor; In the absense of real data, simulated traffic peaks were generated for rush hour only. |
Scheduled Road Events | No | Demo data only; no real-time event monitoring | Scheduled road closure events from static Open511 file loaded on reboot | Good for some events; too much descriptive text, not enough structured time intervals |