This is a very difficult question to answer. Whether something is an urban road, or not, is quite subjective. OSM doesn't have good coverage of the physical descriptive things that would allow you decide whether a road is urban (e.g. lanes, road width, footpath, parking status). Maybe you could look at surrounding features (like how many km of residential roads there are? How many buildings are nearby? Speed limit of the road?) Can I ask what you're trying to do? Perhaps there's a better solution? answered 22 Jun '15, 10:13 rorym Thanks for your suggestion. My end goal is to find the max speed.I have longitude and latitude value only. I put longitude and latitude value to url as a parameter: http://nominatim.openstreetmap.org/reverse?format=json&lat=<latitude>&lon=<longitude> Output: { "place_id": "72249684", "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright", "osm_type": "way", "osm_id": "78164485", "lat": "40.713746", "lon": "14.7016650663124", ...... For here I pass osm_id to another url to find speed limit: output <tag k="highway" v="motorway"/> <tag k="int_ref" v="E 45"/> <tag k="lanes" v="2"/> <tag k="lit" v="no"/> <tag k="maxspeed" v="90"/> <tag k="name" v="Autostrada A3 Napoli-Reggio Calabria"/> <tag k="oneway" v="yes"/> <tag k="ref" v="A3"/> <tag k="surface" v="asphalt"/> </way> </osm> From this output we can extract the maximum speed for that particular longitude and latitude in two ways First search for the ‘k="maxspeed"’ tag in the XML output, and extract the ‘v’ value for the tag. That represents the max speed in km/hrs. format. If above tag not present search for ‘k="highway"’ tag, and get the ‘v’ attributes value; Next we need to have a lookup table from where we can get the default value for highway types. Please find the below link for lookup table for different country: http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed.
(22 Jun '15, 10:35)
Gauravk
Gauravk, is there a kind of government (city, regional, provincial and country wide), who have a highway plan released with categories like the one you’re searching ? Those plans should or could contain urban or interurban ways and eventually other categories of ways.
(22 Jun '15, 21:45)
Hendrikklaas
Thanks for you comment. Its is kind of GPS. Still no luck I hope someone will help me out here.
(24 Jun '15, 07:29)
Gauravk
There is no easy solution to your problem. The only thing you can do is creating a heuristic based on the information mentioned in rorym's answer. Currently most routers don't even create complex heuristics but instead just look at the highway class and surface value if no maxspeed tag is present.
(24 Jun '15, 08:21)
scai ♦
Thanks scai,How can I use Tag:surface for urban area?
(24 Jun '15, 09:54)
Gauravk
That's not what I meant. But you can use it additionally to the highway class to guess the maxspeed if it is not present.
(24 Jun '15, 10:10)
scai ♦
showing 5 of 6
show 1 more comments
|
Although I am not sure about your practical reasons, here is one possible geometry based option. The answer is an interpretation/application of a higher grade student task in algorithms to your case (naturally, many fine details are left out).
1. Assume, from an OSM Planet-dump (or from other OSM based sources) and for an area of interest you have extracted all area objects that you consider as "urban" (e.g. landuse=residential, and landuse=industrial ... add filters as you wish). For practical/efficiency reasons you could merge and convert this set of areas into a set "U" of disjunctive closed simple areas (no common border sections, borders belong to the areas and one outer with arbitrary inner borders in relations). answered 25 Jun '15, 09:23 sanser |