Urban road classification and default speed limits

Road signs allow knowing who’s responsible for maintaining each road/street (federal government, state government, or municipal government), but not the type of road. This has caused a lot of confusion and disagreement in the Brazilian mapping community, which for a long time has been divided between classifying roads according to the planned classification (reflecting some sense of importance) or strictly according to observable physical characteristics. The first one leads to a more readable map and appears to be what other maps (Google Maps, Here.com, Waze) are doing, while the second one leads to fragmented road networks with alternating class (thus not reflecting hierarchy) due to many yet unrealized infrastructure improvements. Motorists, cyclists and pedestrians expect road signs to tell them what they are not allowed to do (speed limit, access and turn restrictions, etc.), and this signage is often precarious. The law you mentioned only applies when signage is completely absent, and at least for speed limits, it is generally not absent in the main ways. It is also often present in more local ways in the more developed regions of the country, but even in those regions it is often absent in the poorest areas.

Regarding urban ways, there is some reasonable consensus that mappers should try to adhere to the published road hierarchy for the respective municipality. The degrees to which this was applied to the map vary greatly from region to region, depending on the number of local contributors.

Regarding rural ways, there has been much discussion, the most recent being this one. At least in Rio Grande do Sul, trunk roads were chosen collectively by vote to try to emulate the British model, on which communities from other countries (including Germany and other European countries) based their current rules. Something similar seems to be happening in Argentina. There have been none less than seven proposals for highway classification in Brazil, an although this one from 2013 is the only approved one (contrary to what would be suggested by this article), its problematic results have received heavy criticism since 2014.

Also, the official types of highways in Brazil are largely based on the American functional highway classification, same as proposed here. However, ways that do not correspond exactly to any physical profile of the official highway types (as defined by regional highway planning departments) can often be found.

Reading your table, I just realized you mostly want an association between speed limit and the national road designations.

That text is slightly outdated. This is the official source for that law. Since mid 2016, the conditions are as follows:

  • 30 km/h on urban local ways

  • 40 km/h on urban collector ways

  • 60 km/h on urban arterial ways and rural unpaved ways

  • 80 km/h on urban fast transit ways

  • 90 km/h on rural paved highways for cargo vehicles (hgv, goods) and other heavy vehicles (buses, minibuses and motorhomes)

  • 100 km/h on rural paved single carriageways for light passenger vehicles (motorcycles and cars)

  • 110 km/h on rural paved dual carriageways for light passenger vehicles

Fun fact: 25 km/h on cycleways for electric bicycles (moped, mofa).

As the highway tag denotes importance in a general sense (and the wiki is quite vague about how to evaluate importance, a well-known problem) and physical characteristics do not strictly determine importance (eg. many important rural paved highways are single carriageway with 2 lanes whereas many less important urban arterial ways are dual carriageway with 3 or more lanes for each direction), I think such an association is currently not possible in a reliable manner. One gets far better results (better routing and, when supported, correct speeding warnings) by simply mapping the legal speed limit.

Cool, I will update the information with the official source.

Though, my main question remains:
In the event of absent signs, how would a driver tell urban local ways, urban collector ways, urban arterial ways and urban fast transit ways apart from each other? In other words, are there any OSM tags with which this could be derived?

If there are no existing ones (and the absence of signs is actually something that can happen in reality), I fear we would need to define some. But only if for a surveyor, it would even be possible to determine this somehow, that is why I asked the question this way (“how would a driver tell … apart?”).

You talked a bit about the struggle to reach national consensus about road classifications. I can tell you, that for the legislations projected in the default speed limits wikipage I have been working on, so far there is not one country, where the highway tags given in OSM could be translated directly to imply certain speed limits (except highway=motorway), i.e. highway=primary would be always 100 km/h, highway=secondary always 80 km/h and so on.
This is because the legislations, luckily, usually either define default speed limits by road features (paved or not, separated carriageways or not, number of lanes), signed “zone” limits (living street, bicycle road, school zone,…) or by official road designation (so, ref tag starts with a certain letter, e.g. "I " for US interstate highways).
In other words: To what criteria the national OSM community chooses to classify the road importance (primary, secondary,…) should not be of concern for the implication of which default speed limits apply.

Well, so far at least. Brazil and Peru are the first legislations I came across which do not define road types mentioned in default speed limit regulations in a meaningful way. :wink:

But how would one know, if there are no signs?

Officials seem to assume that the common person does not need to know the road type, only what they can or cannot do on the road. Signage is more common in busier ways, and less common in calmer ways, so you can expect it on dual carriageways and arterials, and will rarely find them on local ways and rural unpaved ways.

Official data usually helps solve this puzzle, but a driver will rarely hold a copy of the official map, especially when traveling within a city. Moreover, cities publish city plans, often containing roads that do not exist yet, which raises questions on whether such classification is correct or even usable in OSM, and probably less so in practice.

Say there is an accident and a judge has to decide whether a driver was above the speed limit. If there is signage, the decision is simple. If there is no signage, I think the judge should consider official plans (including the physical profile of roads, which change city to city) and assume the common driver knows them by heart (surely very few do), but as this is quite unrealistic, often judicial decisions are made subjectively (as terrible as this may seem).

Little parenthesis: I map mostly in the metropolitan area of Porto Alegre. In 2013, I attempted to classify the city using the official physical profiles of streets. That led to a large number of tertiary roads (corresponding to the physical profile of urban collector ways). Looking at the resulting high density of tertiaries, the Brazilian community rejected this idea and recommended staying closer to the city plan. So I did. Here is a map of the official road hierarchy. You can compare that with the one in OSM, which has been accepted for years now. They match closely, but not quite. The differences are mainly due to arterial roads that have not been fully built.

The collector system, not published officially, is inferred from a variety of features on the ground (signage, traffic lights, street width and right of way), controlled for planning aspects (such as density), and was done as a proposal (so far, no complaints, so it stays). So, in this particular city without an official collector system, tertiaries only mean important roads and nothing else.

That cannot be said of the neighbour town of Canoas, which does have a well-defined system of collectors.

In Porto Alegre, the only reliable way one can assign the maxspeed=* tag to any non-arterial way without signage is by comparing the physical profile of the road with the official physical profiles. So, many residential ways end up with maxspeed=40. In some situations, thanks to road signage, collectors end up with maxspeed=30. It is messy, but the best that can be done with official data. The only alternative would be to assume that the absence of collectors means that any non-arterial way is local and therefore maxspeed=30. That is ok, but most would prefer to be taken through the slightly wider residential ways, that are faster. As if this weren’t enough, most residential ways have a speed sign somewhere along their path, usually old and difficult to see, usually confirming that their speed limit is indeed that predicted from the physical profile. As the sign is not very visible, few people know the actual speed limit, and driving above the speed is common.

In the neighbour city of Canoas, however, the official map can be used to assign maxspeed, regardless of physical characteristics, except in really extreme conditions (such as narrow paths through slums that the municipality wants to, one day, turn into fully functioning standard local ways).

Then, of course, we have a problem finding every city plan. We have around 150 so far (most collected and put on the wiki by me), and Brazil has over 5k municipalities. Surely it is easier to guess road hierarchy on small cities, but nonetheless this is quite a problem for us.

It was very fun here to watch Waze assign speed limits to residential ways when they enabled that feature. Some residential ways still incorrectly have a speed limit of 70 km/h on Waze (!), whereas others that I often pass had a varying limit depending on the day, probably because wazers were discussing what the actual limit should be. The fewer wazers in an area, the slower this process seemed to unravel.

So you say, the only way to know about the classification of a road is to look at government issued official plans? There are no refs, it is not part of the name of the road, it cannot be determined by the physical profile of the road, there is no signage. Right?

So then, it is not possible to determine the default speed limits automatically.

The last resort, you mentioned it halfway already - if it is (only) visible by looking at how the city is laid out, it should be also visible on OpenStreetMap what would likely classify as a local, collector, arterial and fast transit road. Given that on arterial and fast transit ways, signage is (more) common, one can make the an approximation. E.g. roads tagged as residential and *unclassified * are considered local roads, tertiary and secondary are collector roads, *primary *are arterial roads and *trunk *are considered fast transit roads.
These rules would however need to be explicitly marked as “fuzzy”, because they’d be just an educated guess.

I did not read your last reply. So, may these official plans be used for the purposes of OSM? If yes, that is all the information we need, it looks like. Then it would be just the question how to put the information displayed there into OSM - by way of adapting the highway-tag to official classification or, if OSM uses a different system of road-importance classification, through some extra tag. I fear I did not completely follow you there on this.

Reference codes (ref=*) can tell you if a road is managed by a municipality, a state government, or the federal government. Some state or federal ways go through city, some are quite unimportant and simply go through empty space or farmland (not leading to any big settlement and being used seasonally for carrying produce), and some municipal ways are more important than them, so the overlap makes the distinction very unreliable.

Names tell you almost nothing about a road’s importance. They only serve the purpose of identification of ways. It is a common mistake to assume that “rua” (street) and “avenida” (avenue) imply a distinction of importance, but that is often not the case (eg. a primary street and a tertiary avenue). The association between the name and its role in the city plan has been lost many decades ago in Brazil, though one day it existed.

The physical profile can tell you whether a road was built according to plan or emerged organically (in the case of illegal settlements). Also, official physical profiles have evolved over time, and current profiles do not map exactly to older ones. Also, the current physical profile tell little about the planned function of the road, which might require expansion of the infrastructure. The government builds roads based on financial return, and as the economic woes go, a lot of work is left partially incomplete for years. I often cite the route between Porto Velho and Manaus as an example: both are capitals of neighbouring states, yet the route between them is mostly unpaved (and in fact one of the worst in South America). This is less common in the developed area (southeast/center/south near the coast), but can happen, especially in more local roads (such as urban arterials that haven’t been expanded but are busy nonetheless). This is the official road rural map of Brazil and you can notice that the roads are merely described based on their current state of construction, not on their economic/cultural importance, access restrictions, or actual speed limit. On that map, this road (BR-290) and this road (ERS-239) are shown as essentially the same thing (a paved dual carriageway), but the first has a speed limit of 110 km/h and the second one has a limit of 80 km/h.

That would work quite well and would encourage mappers to stick more closely to the official road classes.

Based on my experience, I would suggest assigning only tertiaries to the function of urban collector roads. In debates, I’ve proposed this many times and nobody has ever rejected the idea, and it leads to more readable results (and also makes it easier to guess the speed limit). But surely the community has not gotten this far in discussions about classification yet.

I would have to know the purpose in order to provide a good answer to that. For building your table, this assignment is reasonable and it is as far as the law allows. For routing, assigning those classes to OSM would offer a much better guess for average speed when maxspeed=* is absent than current routing software do (such as OSRM and GraphHopper). Providing speed warnings to navigation software would be more troublesome, as the guessed limit often differs from actual signage, though usually not by much and usually only briefly, except (and here’s a catch) on important busy roads that should be expanded but currently cannot be. So if that’s the intention, it is better to read speed warnings primarily from maxspeed=*.

Also, I might be concerned about establishing any implications in the reverse direction, from maxspeed=* to highway=*. For example, this arterial way, unlike most other arterials in the region, has a reduced speed of 40 km/h throughout its 4 km extension. It is paved and well signaled, but its expansion for higher speed traffic is low priority for the municipality. Nonetheless, it is the main road covering this area and it connects suburbs far apart. The reduced speed, then, shouldn’t be sufficient to argue for lowering its class.

The purpose would be mostly on the side of giving routing software a clue when maxspeed=* is absent, but also information for different vehicle types than the normal passenger car. Something that is missing pretty much entirely in OSM currently.

Also, and that is the reason why I started it at all, is to find a reasonable tagging scheme for tagging roads as “there is no speed limit sign”. Perhaps you know the keys source:maxspeed, maxspeed:type et al.
Basically, it looks very much that these tagging schemes are insufficient, the situation in Brazil is a good example. Nobody wants source:maxspeed=BR:urban_local, source:maxspeed=BR:urban_collector, source:maxspeed=BR:urban_arterial etc. sprinkled everywhere.

While highway=* can continue to be used for rendering to express a more general sense of importance of each way, I think it would be sensible to allow local communities to come up with their own routing_class=* scheme and then try to write a routing profile for the resulting values (communities themselves could provide both the values and the average expected speeds).

In Brazil, values for routing_class could be something like this:

  • br_urban_local: ~15 km/h, br_urban_collector: ~20 km/h, br_urban_arterial: ~30 km/h, br_urban_fast_transit: ~50 km/h (routes through urban areas are usually much slower due to traffic and even at night due to traffic lights and stop signs; these numbers are my guesses and surely need discussion)

  • br_urban_arterial_reduced: ~25 km/h (some cities, often inspired by European practices, actually override the federal law and enforce a speed limit of 50 km/h on all arterials; this is the case of many cities in my state, Rio Grande do Sul, but notably not the case of the capital city, Porto Alegre and while being the case of neighbour cities like Nova Santa Rita)

  • br_urban_unpaved: ~10km/h (quite common in some undeveloped urban areas)

  • br_urban_narrow: ~10km/h (also quite common in some urban areas, specially those that grew organically, such as slums)

  • br_implanted_road: 60 km/h (corresponds to an unpaved highway profile officially called “implantada” which means surface=compacted)

  • br_natural_road: ~40 km/h (corresponds to an unpaved highway profile officially called “leito natural” which means surface=dirt; here, while the legal limit is 60 km/h, the practical speed would be lower due to erosion which is typically expected))

  • br_minor_highway: 80 km/h (most Brazilian highways actually have this speed limit due to legacy and lack of funds to upgrade them to fully-developed motorways, it is actually a better guess to assume this value as default than the other higher values stated by the law)

  • br_single_carriageway: 100 km/h

  • br_dual_carriageway: 110 km/h (though note that most divided highways are actually br_minor_highway due to level crossings, and most divided urban ways are just arterials)

Surely this would not apply to countries like Argentina or Uruguay, they would need their own values and expected speeds. Also, very high speed highways are usually well signaled, so the last two values would only be necessary in the rarer cases when a road is opened for traffic but no investment is made on signage (it happens sometimes). If we were having this discussion in early 2016, then the last two values would have been simply br_highway: 110 km/h, but a transition to the new tagging scheme could have been at least partially automated.

I often use source:maxspeed=sign/markings/implicit, rarely with any other value. But since this is an annotation tag, it could be a computer-unfriendly description, much like *note=**. And then there is maxspeed:practical, which is opinionated and can easily lead to edit wars.

The table in the default speed limits wiki page is supposed to show the limits by law, and only these.

Listing expected/guessed speeds for different road types would need to be be put in a separate list, or, much better, be automatically generated after processing anonymous GPS tracks recorded by navigation software (or people who uploaded their GPS tracks to OSM) perhaps even using live data, if there is enough. Like Google etc. does it.

By law you only get these speed limits. There are only 4 urban types in Brazil: urban_local, urban_collector, urban_arterial, and urban_fast_transit. There are only 3 rural types: rural_unpaved_road, rural_single_carriageway, and rural_dual_carriageway. The rural_unpaved type could be replaced with any of the other two types and surface=unpaved/compacted/dirt. The other two types could be merged into a single rural_highway type if a tagging scheme such as divider was adopted, otherwise the presence of a divider would have to be inferred from geometry. Road signage may override the speed limit implicit from a road’s official type (the most common deviations being 80 km/h in highways and 50 km/h in arterials, both being common), and information on the official type of a road may be unavailable. Some cities may define their own road types, which may not match the national types exactly, and they may also redefine speed limits (most commonly for arterials) while using the national terminology. How frequent these unclear situations are varies from city to city.

Drivers rarely know these types (most drivers have a mental model consisting of only 4 types: “street” corresponding to local or collector, “avenue” corresponding to arterial, “paved highway” corresponding to the two types of carriageways, and “unpaved road”), even more rarely are aware of city plans and their legal implications, and either follow existing signage (which can at best identify paved rural carriageways and often tells the speed limit in higher speed ways but rarely on local and collector ways) or otherwise just follow their gut feeling.

Average speed tends to stay close to the speed limit only in low traffic areas, which is the case of most rural highways but not the usual case of urban ways. Route quality would be higher with average speeds similar to these. So, it depends on your goal.

For example, in the city of Passo Fundo, most of the time one wants to get to the other side of the city taking the roads around it due to heavy traffic within the city. But assuming that one stays at the speed limit (50 km/h) when going through the city, the conclusion is always that going through is faster/preferable, which is incorrect. You can test that in OSM (with OSRM or GraphHopper) and in commercial tools that track traffic patterns such as Google Maps (always avoids the city) or Waze (avoids the city except between 1 AM and 9 AM).

In Uruguay there are one law that does not set maximum speed , and 19 local codes (each departamento has their own rules).
In Montevideo the default maxspeed is 45, and 60 or 75 in a few avenues, and 30 in cycling friendly roads. Most road (if not all) are already tagged.

So it’s not clear if tagging with UY:urban as StreetComplete users (me included) is a good thing, as not all cities have the same default “urban maxspeed”, sometimes is 40, sometimes 45.

Then some kind of tag like maxspeed:practical:conditional=30 @ (Mo-Fr 01:00-09:00) should be added to the streets and be supported by routing software for suggesting the best route depending on date and time.

Muralito, but how are these default speed limits communicated to the drivers? They can surely not be expected to know the regulations by heart, if they are different for every department, right?

Problem is, maxspeed:practical is not a legal speed limit, it is a practicable speed, one that drivers can achieve and maintain. Practicality depends on so many factors, such as vehicle type and driving style. So even though one could capture an average speed (much like Google Maps and Waze do), the definition of that tag in OSM very likely would lead to edit wars due to differences in personal opinions and experiences. Others have already pointed that out. It is surprising that such a page even exists in the wiki while the original proposal was overwhelmingly rejected.

This is also not a legal speed limit, it is an opinionated average speed. I don’t think it is bad for routing software to be opinionated, as long as there is more than one opinion available to choose from (say multiple vehicle and driving style profiles). Different drivers with different vehicles with experience in different cities are likely to believe that the best average speeds are slightly different. And that’s all assuming one is not collecting traffic patterns, which would solve the issue.

Most of the time, by placing speed signs on the fastest urban and rural ways (arterials, fast transit, and paved highways), and leaving most of the other lower, more local ways (collectors, local, unpaved roads) to gut feeling. Speed monitoring is essentially absent on the second group (though it varies), so there’s this culture that people are quite free to drive however they want there, hoping that their self-preservation instinct will moderate speed.

If you ask me, of course education would solve the mess. But then we’ll delve into politics, and the goal of OSM is simply to describe the world.

Local culture plays a considerable part in the self-organization of traffic in Brazil. People that drive between cities tend to drive more aggressively since they feel pressed to cover great distances in shorter time. Sometimes people in the countryside tend to drive more carefully, sometimes it’s the opposite. Traffic authorities prioritize putting signage based on accident statistics, so if a particular local way has had many accidents recently, it will likely get a low speed sign sooner than other local ways. Same goes for higher speed ways with localized problems that cannot be easily solved but still record a high number of accidents (like this curve with tight buffering space, low visibility, slightly irregular terrain, and high pedestrian density due to the bus stops around the bus corridor). In these cases, the speed limit tends to be lower than what would be expected from the physical profile of the street (authorities know that drivers tend to drive faster than the limit, so by setting very low speed limits they’re using psychology to try to get them to slow down to a safe level, which often is a little higher).

So, from the legal perspective, the situation is quite similar to that of Brazil.

My suggestion actually goes more along this idea: if maxspeed is absent, then this scheme I’ve suggested would provide a reasonable guess of the average speed. With few adjustments, it could also provide a reasonable guess (though often inexact) of the legal speed limit. But I’ve been very careful not to suggest that mapping maxspeed is unnecessary, quite the contrary. I’ve used it extensively wherever I’ve mapped, and routing quality has improved significantly in those places, all while respecting verifiability.

But mapping maxspeed takes a lot of survey work, and I understand that @westnordost is exploring a faster way to improve routing.

I’ve also tried to pinpoint that routing based solely on legal speed limits produces poor results at the urban/rural boundary of the network, and that representing this boundary would allow improved (though still imperfect) routing without the need for recording traffic patterns.