Filter out human-relevant data in an OpenStreetMap dump?

I downloaded a full XML dump. While there are lots of nodes and ways, I want to filter out only the human-relevant data.

By human-relevant, I mean neighborhoods, restaurants and landmarks are prefered over telephone poles, junctions, survey artifacts etc which are included in the full result set.

For example, the *nominatim.openstreetmap.org/*reverse service returns homes and other human-relevant places for a given (lat,lon) coordinates, while a dataset may return ways, relationships or irrelevant data.

What is the right criteria for filtering human-relevant nodes from the XML? My best guess is to filter out only nodes and to check if they have attributes with a addr: prefixes

be aware that closed ways like building outlines can also have addr: tags …

You can try osmosis or osmfilter or osmium to do some filtering processes. Search the OSM wiki to find descriptions.

You should know on your own what data is relevant for you … in cases of doubt about some tags, ask here again.

Hello aitchnyu, what is relevant? Relevance depends on the perspective. What’s important for someone may be irrelevant for someone else.

As Stephan has pointed out already: the tags you need are not always at node level. Even restaurants may be mapped as relations with own ways for inner and outer. You might want to convert all relations and all ways to nodes before you start filtering.

There’s a plugin for Osmosis:
http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage_0.40#–areapoints_.28–a2p.29
It works for closed ways only.

And there’s an option in osmconvert: --all-to-nodes
http://wiki.openstreetmap.org/wiki/Osmconvert#Dispose_of_Ways_and_Relations_and_Convert_them_to_Nodes
Works for ways and relations.