Besides importing everything into a postgis db and then filtering through SQL queries
there's a couple different tools to do this specifically with OSM data where you can input an osm file and select what you want to keep or ignore, and have .osm as an ouput.
As for your suggestion about filtering out everything except Addr: , you will miss out on a lot of amenities (e.g. restaurants, schools, etc) that you'd would probably want to keep because they do not have an address.
Osmosis is the tool that you're looking for.
Osmosis has a couple important /filters that you'll need:
- --way-key-value (--wkv)
- --way-key (--wk)
- --tag-filter (--tf)
You can learn how to use the first four filters that I mentioned above at the detailed usage page of osmosis on the OSM wiki,
As mentioned, go through the map features page linked above and find out which tags that you want to keep.
For example: you'll likely want to keep all objects that have the key amenity or highway, so you would issue:
osmosis --read-xml file="input.osm" --way-key keyList="highway,amenity" --used-node --write-xml file="output.osm"
However, some tags (like amenity) are both used as nodes and ways, so you'll have to run this again, using --node-key.
If you end up with multiple files after filtering, you can then merge them together.
It's been a couple months since I last used osmosis, so as I write this I'm thinking you maybe able to just run -tf once instead of using --node-key and --way-key, but I am NOT sure and didn't test this.
--read-xml input.osm \
--tf accept-ways highway=* \
-tf accept-nodes amenity=* \
-tf accept-ways amenity=* \
--tf reject-ways amenity=graveyard \
--tf reject-nodes amenity=graveyard,fire_hydrant \
--tf reject-relations \
Also, check out the wiki and TAGINFO to see what tags are often used.