Obtain road type from nominatim
-
28-06-2021 - |
Pergunta
Is there a way of obtaining the type of road an object is settled in from a request via nominatim?
For example
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!
Solução
Nominatim is for searching addresses, you probably want to use the OverpassAPI to query roads around the given coordinates:
http://overpass.osm.rambler.ru/cgi/interpreter?data=[out:json];way[highway](52.52,-1.82,52.55,-1.81);out;
Then choose the one matching your coordinates the best and look at the highway= value.
Outras dicas
You can use format=jsonv2
instead of format=xml
or format=json
.
format=jsonv2
adds the next fields to response: place_rank
,category
, type
,importance
, addresstype
.
I added this information to Nominatim Reverse Geocoding documentation.
When category tag contains value highway
the type
tag shows the road type.
Find more information about highway types
at OpenStreetMap highway tag