Tomtom POI's from openstreetmap

Long time no post, I know ;-) But now I'm back again :-p

As an owner of a Tomtom via 120, I wanted to update the POI's, but I didn't want to pay for just updating the Points-of-Interest. As I'm participating in openstreetmap.org, I've decided to use those POI's and upload them to my device. Sadly, most or even all providers of these files seem to no longer update their data for Switzerland (http://eofw.org/osm/ for example). Therefore I decided to generate these files on my own, shouldn't be too much of a hassle.
My tool of choice was osmosis, which uses the planet.osm (or an extract of it) and lets you filter based on your own criterias.

I've decided to create the following POI-files:

switzerland_bar-pub-club.ov2
switzerland_car-stuff.ov2
switzerland_fuelstations.ov2
switzerland_hotels.ov2
switzerland_pharmacy-hospital.ov2
switzerland_restaurants.ov2
switzerland_supermarkets.ov2

I decided to merge all restaurants + cafe's + fast-food shops into one file, as well did I merge pubs + bars + nightclubs into a single file. For details of the applied filters, check the script below. The '--tf accept-nodes name="*"' is used to filter out unnamed shop's etc, which would appear as osm-idXXX, which I don't like.

And now finally the script:

#!/bin/bash
## get most recent planet file
mv switzerland.pbf switzerland.pbf.old
wget "http://planet.osm.ch/switzerland.pbf"

## let osmosis generate the custom-filtered POI's
osmosis --rb switzerland.pbf --tf reject-ways --tf reject-relations --tf accept-nodes amenity=fuel --wx switzerland_fuelstations.osm 
osmosis --rb switzerland.pbf --tf reject-ways --tf reject-relations --tf accept-nodes amenity=pharmacy,hospital,doctors --wx switzerland_pharmacy-hospital.osm 
osmosis --rb switzerland.pbf --tf reject-ways --tf reject-relations --tf accept-nodes name="*" --tf accept-nodes amenity=pub,bar,nightclub --wx switzerland_bar-pub-club.osm 
osmosis --rb switzerland.pbf --tf reject-ways --tf reject-relations --tf accept-nodes name="*" --tf accept-nodes amenity=restaurant,cafe,fast_food --wx switzerland_restaurants.osm
osmosis --rb switzerland.pbf --tf reject-ways --tf reject-relations --tf accept-nodes name="*" --tf accept-nodes shop=supermarket,convenience,bakery,kiosk,mall --wx switzerland_supermarkets.osm 
osmosis --rb switzerland.pbf --tf reject-ways --tf reject-relations --tf accept-nodes name="*" --tf accept-nodes tourism=hotel --wx switzerland_hotels.osm
osmosis --rb switzerland.pbf --tf reject-ways --tf reject-relations --tf accept-nodes shop=car,car_repair,car_wash --wx switzerland_car-stuff.osm 

## generate ov2 file (gpx intermediate step, to fix names)
for i in $(find -iname "switzerland_*.osm") ; do
  INPUT=$i
  OUTPUT=$(echo $i | sed 's/\.osm/.ov2/g')
  TMPFILE1=$(mktemp)
  TMPFILE2=$(mktemp)

  gpsbabel -i osm -f $INPUT -o gpx -F $TMPFILE1
  egrep -v '<cmt>|<desc>' $TMPFILE1 > $TMPFILE2
  gpsbabel -i gpx -f $TMPFILE2 -o tomtom -F $OUTPUT

  rm $TMPFILE1 $TMPFILE2
  rm $INPUT

done

These are my first attempts in using osmosis, so any hints/improvements on the script above are welcome. I guess I could just use a oneliner for all the osmosis commands, but as the script just runs a short time, I can live with that, and this way it's more readable ;-)
As I'm planning on generating these files regularly and upload them here, feel free to let me know if you should miss any category!

Ahh, and before I forget, yes, you can install the POI's without any of the tomtom software (MyTomtom / TomTom home or however it's called)! Just connect it via usb, it'll show up as an additional network-interface (usb0 in my case). Now go ahead and get a DHCP lease. That's it, now your TomTom is accessible via the IP 169.254.255.1. Now either upload the files via WebDav at http://169.254.255.1/personal/pois or use the fancy webinterface using http://169.254.255.1/pcmi/index.html

Cheers,
Raphi