Hi everyone,

a customer has asked if we could include some additional data in our optional roadinfo annotation, specifically around speed limit data, so we now do that.

Speed limits are much more complicated than you might initially think.

  • some types of vehicles have their own speed limits, so we now potentially return maxspeed:bus and maxspeed:hgv (heavy goods vehicles)

  • some roads have sign-posted conditional speed limits, which depends on certain situations, such as time of day, day of week, weather, time of year, or another particular condition. This information is now in the field maxspeed:conditional and maxspeed:conditional:hgv

  • some roads have digital signs that may display a speed limit in certain situations (weather, traffic, etc). This is now in the field maxspeed:variable

While we were exploring the data we found a few other relevant fields we thought were worth adding to our output

  • minspeed - in some countries motorways have a mandatory minimum speed

  • tunnel - if the road segment is in a tunnel and potentially the type of tunnel

  • tunnel:name - if the tunnel has a name

The new fields and the possible values are, as you would expect, explained in the API docs.

'Screenshot of the OpenCage geocoding API documentation explaining the new "maxspeed" fields'

An example:

An API request to those coordinates with the optional parameter roadinfo=1 set will now return

    "roadinfo": {
       "drive_on" : "right",
       "lanes" : 2,
       "maxspeed" : 140,
       "maxspeed:bus" : 80,
       "maxspeed:hgv" : 80,       
       "oneway" : "yes",
       "road" : "Autostrada Wolno\u015bci",
       "road_reference" : "A2",
       "road_reference_intl" : "E 30",
       "road_type" : "motorway",
       "speed_in" : "km/h",
       "surface" : "asphalt",
       "toll" : "yes",
       "toll_details" : {
          "included" : [
             "bus",
             "hgv"
          ]
       }
    }

thus we see that buses and HGVs have a lower speed limit than cars.

As always when discussing road information I need to repeat the key caveat - our road information comes from crowdsourced data sources like OpenStreetMap. It is not in any way “official” or “governmental” data. It may be wrong, incomplete, or out of date. Always drive safely.

Many thanks to the customer that prompted these improvements, and to everyone adding this data to OpenStreetMap.

Happy geocoding,

Ed