Frederik Ramm [mailto:[EMAIL PROTECTED] wrote: >Sent: 30 April 2008 8:56 PM >To: Andy Robinson (blackadder) >Cc: 'Frederik Ramm'; talk@openstreetmap.org >Subject: Re: [OSM-talk] OSM in Europe Statistics > >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.
Thanks for this, very helpful alternative to the rough and ready way I have achieved the same thing using the measurement plugin in JOSM. Your method however is able to refine the statistics considerably if that is needed. Cheers Andy > >Bye >Frederik > >-- >Frederik Ramm ## eMail [EMAIL PROTECTED] ## N49°00'09" E008°23'33" _______________________________________________ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk