User:ManuelB701/Data consuming/Speed limits

From OpenStreetMap Wiki
Jump to navigation Jump to search

Some possible ways how I would calculate maxspeed=* when one isn't provided.

Over the years of OSM history, multiple speed limit tags have been developed. maxspeed=* is the most simple one but has the downside that you're missing the cause of the speed limit which not only has advantages in quality assurance so tags like source:maxspeed and zone:traffic have been developed. Furthermore, these tags can also be used by data consumers to know further restrictions but also has the advantage of flexibility should the legislation change.

General calculation

Tags to always look out for:

  • maxspeed - Speed limits on a given highway=*, should be used as the first source.
  • zone:traffic - The traffic zones which primarily (but not only) affects speed limits. A general example is urban and rural roads.
  • zone:maxspeed - Speed limit zones. This affects speed limits.
  • source:maxspeed - How the speed limit was calculated e.g. is it explicitly given by a sign or implicitly by the highway=* restriction?
  • maxspeed:type - The type of the speed limit. Largely overlaps with source:maxspeed=* in usage.
  • highway - Certain highway=* impose their own speed limits, either by imposing a certain traffic zone or a speed limit zone.
  • oneway - In certain legislations, there is a difference between driving on a single and dual carriageway.
  • urban - In general, urban roads have slower speed limits than rural roads. Generally implied by zone:traffic=*
  • motorway - In most countries, motorways. Usually implied by highway=motorway but can be overwritten in few exceptions (mostly on highway=motorway_link).
  • living_street - In cases where highway=living_street can't be used (usually because the given highway type doesn't fit into the definition of highway=residential)

The values for zone:traffic also apply to source:maxspeed / maxspeed:type. Therefore, if only zone:traffic is given, it implies e.g. maxspeed:type with the same value .

Germany

General traffic zones in Germany and their speed limits
Traffic zones in Germany with their general speed limits.

On its own, the German speed limit is simple:

There is one notable exception: zone:traffic=DE:rural. Although common knowledge tells you that rural roads limit you to 100 km/h, this only applies under the following definitions:

  • The road is a single carriageway and
    • At least one direction has only one lane

On any other road (either any dual carriageway or a single carriageway with at least two lanes per-direction), the speed limit is lifted much like on motorways (which are dual carriageways by default)

A general flowchart looks like this (note that source:maxspeed can substitute in for maxspeed:type):

You can calculate zone:traffic using a combination of motorway and urban: motorway=yes implied zone:traffic=DE:motorway, otherwise if urban=yes then zone:traffic=DE:urban, else zone:traffic=DE:rural. You can calculate maxspeed:type using a combination of zone:traffic and zone:maxspeed: maxspeed:type inherits the value from zone:traffic but if zone:maxspeed is given, take the latter's number and attach it at the end of DE:zone (e.g. if zone:maxspeed=DE:30 then maxspeed:type=DE:zone30)

Using this, you can use maxspeed:type=* to calculate the maxspeed=* with the following values:

Other vehicles have a hard limit so when maxspeed=* ends up being higher, use the lower limit. Note the following special cases:

  • For HGVs with at least 7.5t gross vehicle weight rating, whether you're on a motorroad (which includes motorways because of same restrictions): In general, they're limited to 60 km/h if a higher speed were possible but motorroads raise that limit to 80 km/h.
  • Bicycle have no zone:traffic speed limit so to accurately depict maxspeed=*, you must look at maxspeed:type and if it isn't a zone:traffic value.