Skip to main content

Account for congestion

Out of the box, driving times for cars in Conveyal do not generally reflect congested conditions. Conveyal sets a default driving speed for each OpenStreetMap (OSM) way based on the way's highway tag values (analogous to roadway functional classifications), with the code here. These speed values can be overridden in a custom network bundle configuration or routing engine version (more details coming soon). Note that speeds for public transport service are specified in GTFS or transit modifications, not OSM.

To account for congestion with more refined speed values (e.g. varying by link within a given functional classification) for cars, options include:

  • Prepare a CSV with columns for OpenStreetMap way id and a representative speed value. Speed values can then be to joined the corresponding ways as maxspeed:motorcar tags (using an adapted version of this code), which will override the default driving speeds. This option works best when you can access the specific OSM extract to which your custom speed values are associated (e.g. through the vendor of your speed dataset), or at least the date of the OSM extract, because OSM identifiers are not guaranteed to be stable over time. The Conveyal team can join the CSV to an OSM file and upload the result as a network bundle for your use.
  • Prepare a shapefile with representative speed adjustment factors within polygons. This option is suitable when you want to model congestion in certain areas (e.g. downtown cores), or if you can create narrow buffers around a line layer generated by other tools (e.g. exported from other travel modeling software). The Conveyal team will load polygons you supply as a custom congestion modification, which you can then activate in scenarios like any other Conveyal modification. The speed for any link within a polygon will be multiplied by the polygon's adjustment factor. If a link is within multiple polygons, an optional priority field can be used to indicate which takes precedence.
  • Prepare your own OSM upload, adapting scripts such as this (ignoring the custom generalized cost tags, and just setting maxspeed:motorcar tags). This option gives you the most control, but it may require substantial effort. Furthermore, it relies on tooling authored by other parties, so the Conveyal team cannot guarantee support.