[OSM-talk] Visualizing "Places"

John Harvey john at JohnHarveyPhoto.com
Sat Feb 5 06:58:04 GMT 2011


Hey!

I inadvertently made a cool graph that I thought I would share.

I'm interested in places - country/state/province/city relations, 
airports, ferry terminals, place=suburb kind of stuff.  Some places have 
"is_in" tags, but the vast majority don't.  I wondered if I could 
compute what they should be.  (Don't worry - I'm not going to import 
anything).  I just wanted to know if it was possible.

I wrote a program that gathers every "place" - anything with an admin 
boundary, place={city/town/suburb/village/hamlet} or Airport/Train 
Station/Ferry/Bus Station.  I tried to make a hierarchy.  For instance - 
here is a little bit of New Zealand (1.3MB):

relation 556706: Country New Zealand
556706 New Zealand (2)
   204648 Wellington  City isIn(Country: New Zealand,IsIn: 
capital_cities; North Island; New Zealand)
   692004 Iwikau  Village isIn()
   21634017 Whakapapa  Village isIn()
   26608929 AKL Auckland International  Airport isIn(IsIn: 
Auckland,North Island,New Zealand)
   26608930 WLG Wellington International  Airport isIn(IsIn: 
Wellington,,New Zealand)
   26659470 Baldwin Avenue  Train Station isIn()
   36133906 Naenae  Train Station isIn()

New Zealand (as far as I could find in the Dec 12/22 planet.osm) doesn't 
have level 4/6/10 boundaries.  Compare this to a bit of Australia (~290MB):

relation 80500: Country Australia
80500 Australia (2)
   692856420 Spit Base  Hamlet isIn()
   80370 South Australia (4)
     1042099353 Umuwa Airport  Airport isIn()
     9903 City of Tea Tree Gully (6)
       76306175 Tea Tree Plaza Interchange  Bus Station isIn()
       100121999 Tea Tree Plaza Interchange  Bus Station isIn()
       246490538 Golden Grove  Town isIn(Country: Australia,IsIn: South 
Australia,Australia)
       251127274 Wynn Vale  Suburb isIn()
       366860688 Holden Hill  Suburb isIn()
       92291 Modbury North (10)
         302729567 Modbury North  Suburb isIn()

So I wound up with a folder full of countries - each countries size is 
proportional to the size of the uncompressed .osm.xml that holds just 
the place nodes/ways/relations.  I get that a lot of this data is 
imported - one country may have put a lot more effort into boundaries 
and still be smaller. I'm sure some countries have more nodes in their 
borders than others, but as a first guess I thought it was pretty cool:

http://www.gamesforlittletimmy.com/Countries.png

(http://www.gamesforlittletimmy.com/Countries.png for HTML e-mail impaired)

John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20110204/59719719/attachment.html>


More information about the talk mailing list