[OSM-talk] OSM in Europe Statistics

Frederik Ramm frederik at remote.org
Wed Apr 30 20:56:26 BST 2008


Hi,

> Can someone point me to some simple code/ideas on how to turn the xml osm
> data into way length? I'll then be able to report some findings. I'll also
> write up how I gathered the information needed so that other areas can be
> compared.

There's a script in SVN:

/applications/utils/filter/osm-length/osm-length-2.pl

You'd have to call this like so:

perl osm-length-2.pl < myfile.osm > foo.osm 2> result

and then you'll have in "result" a text file that gives road lengths
for every type of highway contained in the input file (other data is
disregarded). (foo.osm has a copy of myfile.osm with way lengths
added.)

Unfortunately this will also count ways that have an "action=delete"
tag because you deleted them in JOSM. You can work around this by
either making sure that the deleted objects are actually removed from
the file (#12 in JOSM/Advanced_Tricks in the wiki) or, instead of
removing the bits you don't want, just tag them "highway=deleted" and
they'll count towards the extra category "deleted" which you can then
ignore.

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"





More information about the talk mailing list