This is my first time posting here so please forgive me if i ask a trivial question. Is there a way of obtaining the type of road an object is settled in from a request via nominatim? (i have the geocoded sample)

For example: http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1

does provide me with loads of info. yet, there is no info on the road the address is settled in. would like to obtain something like: rural road or even just grade*N* (where N stands for the level of hierarchy.) i hope what i'm looking for is understandable :) thanks in advance!

  • 1
    I think road hierarchy is usually a jurisdictional manner in the true transportation sense. You're best bet is to contact your local transportation agency or the agency responsible for the data and get their GIS classification scheme + layer. I'm not sure about the UK, but in North America a lot of this data is available online for free.
    – dassouki
    Aug 28, 2012 at 16:03

3 Answers 3


The hierarchy of roads is reflected in OSM by the "highway" field. Possible values in hierarchical order are: motorway, trunk , primary, secondary, tertiary, unclassified, residential, service, track, path

See this wiki pages: http://wiki.openstreetmap.org/wiki/Highway:International_equivalence http://wiki.openstreetmap.org/wiki/Highway_tag_usage

highway=road is default for unknown classification (e.g. if only digitized by aerial photo).

BUT: It is allowed to change highway type in order to reflect the importance for routing purposes.

  • Thank you @Andre Joost for your helpful remarks. However, the highway field is not supplied within the xml document returned from a request via nominatim. therefore my question was rather related to how to obtain this information from an API or something similar.
    – Seb
    Aug 29, 2012 at 14:57
  • Thats true, but you get the osm_id. With that you can query the full information of the way element: openstreetmap.org/browse/way/<osm_id> or openstreetmap.org/api/0.6/way/<osm_id> . But keep in mind that the Openstreetmap api is not designed for extensive querying.
    – AndreJ
    Aug 29, 2012 at 15:20
  • Other possibility: get the Geofabrik roads shapefile of your country, and look up the osm_id. Road class is in the "type" column.
    – AndreJ
    Aug 31, 2012 at 9:50
  • 1
    It wouldn't work. Because Nominatim have returned id of way for building (osm_id="90394420" is a building) not for Pilkington Avenue. And it's residential, not road. Mar 11, 2015 at 13:02

You can't do it in one query, but, you can get Nominatim place_id and use details.php


and parse highway information.

Pilkington Avenue (Type: highway:residential, way 218846952, 15, 0 GOTO)

But, Nominatim's wiki says:

Currently the details page (details.php) creates a high load on the server and is only intended as a debugging aide, as a result no xml api is currently provided. Scraping or heavy use is likely to result in an IP ban.


So you if you planed to use this approach often, you will need to setup your own Nominatim or another geocoder instance.


It appears to be undocumented, but you can put lat,lon in the q parameter for search.php and it seems to function as a reverse geocoder and return type information. Try pasting lat,lon into the query box on http://nominatim.openstreetmap.org

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.