[OSM-dev] determining the boundaries of cities?
Martin Koppenhoefer
dieterdreist at gmail.com
Thu May 31 09:45:48 BST 2012
2012/5/30 Ákos Maróy <akos at maroy.hu>:
> I wonder what is the best way to determine city boundaries based on the
> OSM dataset. What I want to do is simply to have each city colored in
> light yellow (uniformly), with a black outline at the edge of each city.
> I'm not concerned about the streets inside the cities, etc.
It is not as easy as it sounds like. Actually we often do not have
this information (directly) in OSM. What you could do is:
* use the landuses and extend them slightly (to also get the streets,
which are sometimes enclosed in the adjacent landuse but actually
shouldn't).
* You could also use residential roads and extend them (draw a hull
around them).
* Last but not least you should look for polygons tagged with
place=town/city. These are IMHO actually the bounds of the settlement
(but mostly that's nodes, not polygons in current OSM).
> One possibility seemed to be to go with:
> boundary = administrative && admin_level = 8
-1, as you already discovered, these are administrative boundaries and
not what you are looking for.
> another approach I tried is going for the landuse property, and consider
> areas with the following values 'cities':...
> but this data seems to be inconclusive. for example, most of the area of
> the city of Budapest is not marked with landuse areas.
yes, we have quite incomplete data for city extensions as a polygon.
One of the reasons is IMHO, that the main mapnik map uses external
data for builtup areas (from natural earth), so people are less aware
that there is something useful missing.
> am I missing something obvious, or is is it the case that the boundaries
> of cities is simply not stored in the OSM dataset?
you can find it in some places, but it's still the minority. Simply
compare the numbers of nodes and ways here:
http://taginfo.openstreetmap.org/tags/place=city
cheers,
Martin
More information about the dev
mailing list