NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm using nominatim to get max road speed

If the data is not present (only around 10% is), I can guess the roadspeed based on road type

i.e. in the UK, if its a residential road, it will be 30mph, and if its a motorway it will be 70mph

However the data returned does not indicate the road type, I get a OSM_TYPE of WAY, but that's it.

Is the above possible? if so how can i alter my call to return this info?

asked 08 Oct '18, 08:22

Mark%20Davies1664's gravatar image

Mark Davies1664
accept rate: 0%

edited 08 Oct '18, 08:23


Nominatim seems like an odd choice to get max road speed?

(08 Oct '18, 08:58) SomeoneElse ♦

Can you give an example query that does not tell you the road type when you expected it to do so?

(08 Oct '18, 08:59) Frederik Ramm ♦

I'm using it to get the road name and roadspeed as one call Here is an example of one

{"place_id":"70381573","licence":"Data © OpenStreetMap contributors, ODbL 1.0. https:\/\/\/copyright", "osm_type":"way", "osm_id":"4968823", "lat":"51.51465608749", "lon":"-3.1915241864833", "display_name":"Heathwood Road, Heath, Cardiff, Wales, CF, UK","address": {"road":"Heathwood Road", "suburb":"Heath", "city":"Cardiff", "county":"Cardiff", "state":"Wales", "postcode":"CF", "country":"UK", "country_code":"gb"}, "extratags":{"foot":"yes", "lanes":"2", "oneway":"no", "surface":"asphalt", "maxspeed":"30 mph"}, "boundingbox":["51.5115152","51.516782","-3.1997308","-3.1860733"]}

(08 Oct '18, 09:25) Mark Davies1664

Which query led to this result - did you do a "search.php?q=Heathwood Road, Cardiff" or rather a "reverse.php?lat=51.514656&lon=-3.191524" or...? Please specify exact URL as it might be relevant for finding the problem.

(08 Oct '18, 09:37) Frederik Ramm ♦

Building up on what Frederik said. Use format=jsonv2, then you'll see a field 'category' and 'type'. Example shows 'category=highway', 'type=tertiary' which is equivalent to 'highway=tertiary' in

Same for forward search,%20Cardiff&addressdetails=1&extratags=1

permanent link

answered 08 Oct '18, 12:44

mtmail's gravatar image

accept rate: 27%

great thanks So in the UK i can assume tertiary and residential are both 30mph, and highway is 70mph

I guess primary, secondary etc are a bit harder to classify so i can leave these as unknown ?

(08 Oct '18, 13:57) Mark Davies1664

Probably. And there might be limits if it's inside or outside a city boundary. maxspeed is complex and I'd check if there was previous discussion on (or start a new one)

(08 Oct '18, 15:22) mtmail

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 08 Oct '18, 08:22

question was seen: 3,396 times

last updated: 08 Oct '18, 15:22

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum