Skip to content

Build route

Measures air legs by great-circle distance, sea and ferry legs over shipping lanes and road legs over roads, and returns the points a map draws.

@lainstack/transport/build-route · Freight · Available on Lainstack Cloud

Use Build route to measure each leg of a shipment and get the points a map draws. It reads your legs and the places Find place found.

Good to know:

  • Legs needs Leg, From, To, Mode and Mass (kg), and may have Distance (km) and Distance basis. Places is Find place’s Found. From and To match a place, ignoring capitals, accents and punctuation.
  • Air legs get the great-circle distance: the shortest path over the Earth’s surface, not the flown route.
  • Sea and ferry legs get the shortest path over Eurostat’s shipping lanes, an estimate. Each port joins the nearest lane by a straight line, which counts in the distance; a place more than 100 km from every lane is not routed. Sea canals can avoid Suez and Panama. Arctic routes are not used.
  • Road legs get an estimated truck route over OpenStreetMap roads that Road vehicle may use, by weight, size and axles. Both places must be inside the road coverage and within 5 km of a road. A route that takes a ferry or a shuttle train is split into rows: leg L7 becomes L7-1, L7-2 and so on, with mode ferry for the crossing and rail for the shuttle train. Road routing must be set up for your install; without it road legs are not routed.
  • Measured distances are in km to 0.1 km, with basis great_circle or route. A leg with a distance keeps it.
  • Route points follow each measured leg. Sources names the data behind the step’s distances; show it with your results. Estimate transport emissions reads the Legs output.
  • Not routed lists legs with no distance and why, such as rail and inland waterway legs, a place outside the road coverage, or a missing place.
  • One step finds up to 1,000 sea routes and 200 road routes. If road routing does not answer, the step fails and you can run it again.

Shipping lanes: Eurostat SeaRoute marnet, under the EUPL-1.2. Roads: © OpenStreetMap contributors.

Setting Key Type Details
Legs (required) legs Value A Table of legs from an earlier step.
Places (required) places Value The places found by Find place.
Sea canals seaCanals One of Use Suez and Panama (default), Avoid Suez, Avoid Panama, Avoid Suez and Panama Sea routes take the shortest path and use the Suez and Panama canals where that is shorter. Avoiding Suez sends most Europe–Asia legs round the Cape of Good Hope, though some from East Asia go through Panama instead; avoid both to send them round the Cape. Default use_both.
Road vehicle roadVehicle One of Average HGV: 44 t, 16.5 m long, 4.95 m high (default), Articulated HGV: 44 t, 16.5 m long, 4.95 m high, Rigid HGV: 32 t, 12 m long, 4.95 m high, Van up to 3.5 t: 3 m high, 2.1 m wide Road routes keep to roads this vehicle may use, by its weight, size and axles. Choose the same vehicle as in Estimate UK transport emissions. Default average_hgv.
Output Path Type
Legs legs Value
Route points routePoints Value
Not routed notRouted Value
Sources sources Text

Last updated: