Motorcycle and Scooter Routing
A motorcycle isn’t a car, and a 50cc scooter is definitely not one. Set mode to motorcycle or motor_scooter and Plaza uses that vehicle’s speeds, the roads it may legally ride, and the preferences riders care about: curvy roads and gravel for motorcycles, quiet streets and flat ones for scooters.
Both modes work on Directions, Isochrones and the Distance Matrix. All three are premium endpoints, so each request counts as 4x. The modes and their options also work on Route Optimization, the Meeting Point, Map Matching and Routing Debug.
What the two modes do
Section titled “What the two modes do”Both ride like a car in traffic. They follow one-way streets and turn restrictions (plus restriction:motorcycle or restriction:moped; except=motorcycle or except=moped lets them through), wait at the same junctions and traffic signals, and with depart_at they slow down with the same time-of-day profile. Speeds are capped by the road’s maxspeed, or the country’s default limit when the road has none, and slowed by rough surfaces.
Motorcycles ride every road a car may use. Tracks (highway=track) join the network when use_trails is above 0. On climbs they slow down like cars: 95% of the speed on a 2-4% grade, 90% at 4-6%, 85% at 6-8% and 75% above that.
Motor scooters never ride motorways or their links, and keep off motorroad=yes expressways unless the way’s moped tag is yes, designated or permissive. They never ride tracks. Their speed is capped at 45 km/h. Send top_speed to change the cap, up or down, for a faster 125cc or a slower 25 km/h moped. Climbs hit them harder: 90% of the speed on a 2-4% grade, 80% at 4-6%, 70% at 6-8%, 60% at 8-10% and half speed at 10% and steeper.
Grades need elevation data for the road, and only uphill slows either vehicle.
| Road class | Motorcycle (km/h) | Motor scooter (km/h) |
|---|---|---|
| motorway | 120 | not ridden |
| trunk | 100 | 45 |
| primary | 80 | 45 |
| secondary | 70 | 45 |
| tertiary | 60 | 40 |
| unclassified | 50 | 35 |
| residential | 40 | 30 |
| service | 30 | 20 |
| living_street | 20 | 15 |
| road | 25 | 25 |
| track | 25 (with use_trails) | not ridden |
Motorcycle link roads run from 70 km/h (motorway_link) down to 40 km/h (tertiary_link). Scooter links are 40 km/h, and 35 km/h for tertiary_link. A scooter’s trunk, primary and secondary roads go faster than 45 km/h when you raise top_speed: up to 100, 80 and 70 km/h.
Access tags
Section titled “Access tags”| Mode | Tags read, most specific first | Closed by |
|---|---|---|
motorcycle | motorcycle, motor_vehicle, vehicle, then access | no, private, agricultural, forestry |
motor_scooter | moped, motor_vehicle, vehicle, then access | the same values, plus motorroad=yes |
So motorcycle=yes opens a road that access=no closes, and motor_vehicle=no closes it to both modes. mofa is not read: it covers slower vehicles (25 km/h), and a mofa ban doesn’t apply to a scooter.
The same tags decide the access penalty a route avoids: destination or delivery costs 600 seconds of routing cost and customers 300, plus 15 on service roads and tracks. Each mode reads its own tags, so motorcycle=destination steers a motorcycle away while motorcar=destination with motorcycle=yes doesn’t. The penalty only changes which way the route goes. duration_s doesn’t include it.
Rider options
Section titled “Rider options”Send them in a motorcycle or motor_scooter object. Anything you leave out takes the default. These options change which way the route goes. They are not added to duration_s, which stays the travel time.
Motorcycle
Section titled “Motorcycle”| Field | Type | Default | What it does |
|---|---|---|---|
style | string | "touring" | touring favours paved main roads. adventure avoids motorways and trunk roads and doesn’t mind gravel. |
use_trails | number, 0-1 | 0 touring, 0.5 adventure | 0 keeps to roads. Above 0, tracks are ridden, and the closer to 1 the more readily. |
use_curves | number, 0-1 | 0.5 touring, 0.8 adventure | Above 0.5 winding roads are preferred, below 0.5 avoided. |
lane_splitting | boolean | false | The rider filters between lanes of queued traffic. See Lane splitting. |
How each style prices a road, as a multiplier on its travel time:
touring | adventure | |
|---|---|---|
| Motorways and trunk roads | 0.95 (primary roads too) | 1.5, links included |
| Service roads | 1.3 | 1.0 |
| Tracks | 1.5 | 0.85 when unpaved |
| Compacted, fine gravel | 1.3 | 1.1 |
| Gravel, unpaved | 2.5 | 1.1 |
| Dirt, earth, ground, grass | 2.5 | 1.3 |
| Sand, mud | 10 | 2.0 |
A track without a surface tag counts by its tracktype: grade2 and grade3 as gravel, grade4 and grade5 as dirt. On top of the style, tracks cost 1 + 4 * (1 - use_trails) times their travel time.
Plaza measures curviness on each stretch of road between two junctions: its length divided by the straight-line distance between its ends. A winding road crossed by side roads is scored stretch by stretch. A bend that falls exactly on a junction doesn’t count, because it sits between two stretches. Stretches shorter than 100 m don’t count either, since most of them are roundabout arcs and slip roads. At use_curves: 1 a very winding road costs 0.4 times its travel time, and at 0 it costs 1.6 times.
Lane splitting
Section titled “Lane splitting”Riding between lanes of slow or stopped traffic is legal in some places (California, much of Europe and Asia) and banned in others, so Plaza leaves it off and lets the rider turn it on with lane_splitting: true.
It only matters with depart_at, because that is when roads carry a time-of-day traffic profile. On urban motorways, trunk and primary roads (and their links) with at least two lanes in the direction of travel, the route counts half of the slowdown the profile gives the road. A road the profile slows to 40% of its free-flow speed costs as if it ran at about 57%. Two-lane roads with one lane each way, rural roads, and anything without a profile are unchanged, and so is a route with fixed_speed.
Like the other rider options it steers the route and nothing else: duration_s is still the car traffic time, since the profiles describe cars and Plaza has no measured times for filtering riders. Isochrones and matrices ignore it.
Motor scooter
Section titled “Motor scooter”| Field | Type | Default | What it does |
|---|---|---|---|
use_primary | number, 0-1 | 0.2 | Lower values avoid busy roads. Primary roads cost 1 + 2 * (1 - use_primary) times their travel time. Trunk roads and anything with a speed limit of 80 km/h or more cost 1 + 3.5 * (1 - use_primary). Residential and living streets get a 0.9 discount whatever the value. |
use_hills | number, 0-1 | 0.5 | Lower values avoid steep roads, up or down. Above a 3% grade a road costs 1 + 1.5 * (1 - use_hills) times its travel time, above 6% 1 + 3 * (1 - use_hills), above 10% 1 + 6 * (1 - use_hills). Needs elevation data. |
A value out of range, an unknown field, or an object sent without its mode is a 422 validation_error, for example motorcycle style must be one of touring, adventure or motorcycle options require mode "motorcycle".
Costing options
Section titled “Costing options”The general route costing options work for both modes: use_highways, use_tolls, use_ferries, use_living_streets, shortest, top_speed, fixed_speed, maneuver_penalty, service_penalty, gate_cost, toll_booth_cost and country_crossing_cost. use_highways multiplies with the style instead of replacing it. Adventure prices motorways and trunk roads at 1.5 times their travel time. use_highways: 1 brings that down to about 1.35, so an adventure route still takes a motorway only when it saves real time. To ride motorways freely, use the touring style. For a scooter, motorways stay out whatever use_highways says. use_tracks is for walkers and cyclists; motorcycles use use_trails. With shortest: true the route minimises distance and the rider options (style, use_curves, use_trails as a preference, use_primary, use_hills) no longer steer it; use_trails: 0 still keeps tracks out.
ev plans an electric motorcycle or scooter; see Electric motorcycles and scooters. Recostings accept motorcycle and motor_scooter as their mode.
A route
Section titled “A route”A curvy ride from Annecy to Chamonix:
curl -X POST https://plaza.fyi/api/v1/route \ -H "x-api-key: $PLAZA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "origin": { "type": "Point", "coordinates": [6.1294, 45.8992] }, "destination": { "type": "Point", "coordinates": [6.8694, 45.9237] }, "mode": "motorcycle", "motorcycle": { "style": "adventure", "use_curves": 1 } }'The response is the usual route Feature with four more properties:
{ "type": "Feature", "geometry": { "type": "LineString", "coordinates": [[6.1294, 45.8992], "..."] }, "properties": { "distance_m": 104215.4, "duration_s": 6120.7, "mode": "motorcycle", "motorcycle": { "style": "adventure", "use_trails": 0.5, "use_curves": 1.0, "lane_splitting": false }, "curviness_avg": 1.27, "surface_breakdown": { "paved": 0.91, "gravel": 0.03, "unknown": 0.06 } }}modeismotorcycleormotor_scooter.motorcycleormotor_scooterechoes the options the route was planned with, style defaults filled in.curviness_avgis the length-weighted curviness of the route’s roads. 1.0 is dead straight.surface_breakdownis the fraction of the distance on each surface:paved,compacted,gravel,dirt,other(a surface tag outside those) andunknown(no surface tag). Only the surfaces on the route appear.
Alternatives and routes with waypoints carry the same properties.
The same route in PlazaQL, where the options are keyword arguments:
route( origin: point(45.8992, 6.1294), destination: point(45.9237, 6.8694), mode: "motorcycle", style: "adventure", use_curves: 1);Both PlazaQL and the REST API also accept "motorbike" for "motorcycle", and "scooter" or "moped" for "motor_scooter".
A scooter commute that stays off main roads and hills:
route( origin: point(41.3874, 2.1686), destination: point(41.4036, 2.1744), mode: "motor_scooter", use_primary: 0, use_hills: 0.2);Isochrones and matrices
Section titled “Isochrones and matrices”mode, motorcycle and motor_scooter work the same way on POST /api/v1/isochrone and POST /api/v1/matrix:
curl -X POST https://plaza.fyi/api/v1/isochrone \ -H "x-api-key: $PLAZA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "geometry": { "type": "Point", "coordinates": [2.1686, 41.3874] }, "time": 900, "mode": "motor_scooter", "top_speed": 60 }'isochrone(center: point(41.3874, 2.1686), time: 900, mode: "scooter", top_speed: 60);
matrix( origins: [point(45.8992, 6.1294)], destinations: [point(45.9237, 6.8694), point(46.2044, 6.1432)], mode: "motorcycle");Both measure travel time, so the preferences (style, use_curves, use_primary, use_hills) don’t change them. Speeds and roads still do. use_trails decides whether tracks are in the network at all, and since adventure defaults it to 0.5, an adventure isochrone can reach further down tracks than a touring one.
Electric motorcycles and scooters
Section titled “Electric motorcycles and scooters”Add an ev object to a motorcycle or motor_scooter route and Plaza plans charging stops the way it does for electric cars. Two things change.
The planner uses about 80 Wh/km for a motorcycle and about 40 Wh/km for a scooter, where a car gets 190. Set battery_capacity_wh to your bike’s usable capacity; that’s often 10,000 to 20,000 Wh for a motorcycle and 1,500 to 4,000 for a scooter.
Without connector_types, a two-wheeler only stops where it can plug in: Type 1, Type 2, CCS, CHAdeMO, and household or camping sockets (Schuko, French Type E, UK, US, Swiss and Australian plugs, blue CEE). Tesla-only sites are skipped. Set connector_types if your bike takes something else.
The route uses the mode’s own roads, speeds and rider options, and reports mode, the options, curviness_avg and surface_breakdown next to the charging plan. Charging times use the charger’s power; many bikes charge slower than that on AC, so read them as a lower bound.
curl -X POST https://plaza.fyi/api/v1/route \ -H "x-api-key: $PLAZA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "origin": { "type": "Point", "coordinates": [2.3522, 48.8566] }, "destination": { "type": "Point", "coordinates": [1.0999, 49.4432] }, "mode": "motorcycle", "motorcycle": { "style": "touring" }, "ev": { "battery_capacity_wh": 15000 } }'In PlazaQL, ev_route() takes the mode and the rider keywords:
ev_route( origin: point(48.8566, 2.3522), destination: point(49.4432, 1.0999), battery: 15000, mode: "motorcycle", style: "touring");Trucks still can’t use ev (422).
Limits of the data
Section titled “Limits of the data”Speeds are class defaults, not measured motorcycle traffic. Curviness comes from geometry alone, so a road that is twisty but broken into many short segments in OSM can look straighter than it rides. Lane splitting is a fixed half of the car slowdown on the roads above, not measured rider speeds. And like every mode, access is only as good as the tags: a road closed to motorcycles that nobody tagged stays open.