[Talk-is] GPS trökk á höfuðborgarsvæðinu

Ævar Arnfjörð Bjarmason avarab at gmail.com
Fri Mar 13 00:10:08 GMT 2009


2009/3/12 Karl Palsson <tweak at tweak.net.au>:
>
> Can't you download all the gpx tracks from OSM themselves?
>
> Potlatch shows you them as an overlay for instance.

This is harder than you might think since the API doesn't expose the
GPX tracks very well, you can only get all GPX *points* within a given
bbox via the API (you then have to guess which points form a track).
Potlatch cheats and talks to the DB directly however.

But with some clever hackery we can get around all that:

Compile a list of the 60 most active users who've edited Iceland
according to the Iceland.osm dump on osm.nix.is:

$ bzgrep user= /var/www/osm.nix.is/root/latest/Iceland.osm.bz2 | perl
-pe "s/.*?user='(.*?)'.*/\$1/g" | sort  | uniq -c |sort -nr | head -n
60 | perl -pe 's/^\s+\d+ //' > users.txt

Use a couple of hacky scripts I wrote for the occasion to download all
GPX tracks for those users by scraping the web interface:

http://git.nix.is/?p=avar/gps;a=tree;f=script;h=eb16c39910e2667dc815e332842b3b28deb1f05e;hb=master

$ perl get-osm-gpx-tracks-for-users < users.txt

The result is 258MB of GPX tracks:

http://u.nix.is/Iceland-GPX.tar.bz2




More information about the Talk-is mailing list