Another option is to use GDAL http://gdal.org/ogr/drv_osm.html
This is how you can do it on Windows and write out POIs directly into shapefile.
Acquire development version of GDAL from http://www.gisinternals.com/sdk/
Select a suitable version, for example for 32-bit Windows
http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-gdal-mapserver.zip
Download and unzip, let’s say into c:\gdal_dev
Open Windows command window, go to c:\gdal_dev and run sdkshell.bat
Now search file osmconf.ini from c:\gdal_dev\bin\gdal-data and open it with text editor.
Edit the point layer section so that the key list in parameter “attributes” contains “amenity”
and save the file. Here is an example of an edited section
[points]
common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
keys to report as OGR fields
attributes=name,amenity,fee
keys that, alone, are not significant enough to report a node as a OGR point
unsignificant=created_by,converted_by,source,time,ele
keys that should NOT be reported in the “other_tags” field
ignore=created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
uncomment to avoid creation of “other_tags” field
other_tags=no
Next dowload some OSM data in .pbf format from http://download.geofabrik.de/osm/
Finally convert as
ogr2ogr -f “ESRI Shapefile” toilets.shp osmfile.osm.pbf -sql “select * from points where amenity=‘toilets’”
What happens here is
- output is directed into shapefile “toilets.shp”
- input file is “osmfile.osm.pbf”
- OpenStreetMap POIs with tag “amenity=toilets” get selected
Ogr2ogr command is easy to adjust for selecting something else. Just take care that osmdonf.ini includes all the tags which are used in the SQL query and what you want to get into the resulting dataset. Output can be any format that GDAL/OGR supports for writing, including KML http://gdal.org/ogr/ogr_formats.html. All the projections are supported too, and everything works in a similar way on Linux and Mac.