This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

How to filter tags

0

Hi,

I want to filtering tags (name) but only for a type of object.

Indeed, I want to remove name for only amenity and building object. I tried but for the moment I don't find the solution. My last try was :

osmfilter output2.osm --drop-tags="amenity=name"> output1.osm

And I don't know if it's possible.

Thank you for your help.

Michael

asked 20 Mar '15, 14:50

mickmac's gravatar image

mickmac
11112
accept rate: 0%

edited 22 Mar '15, 13:41

iii's gravatar image

iii
4.9k84082


One Answer:

1

Your statement drops only object tags with the real value 'name' which isn't that you want to archive. So if you take a look at the docs, you see that you need a wildcard or at least open filter experession:

./osmfilter a.o5m --drop-tags="oneway= name=" -o=plain_ways.o5m

You can also add an --keep="amenity=" to return only amenity nodes/ways/relations and remove their names (if this makes sense to your scenario?)

Edit: I changed the doc link to drop "Tags" as that is what is wanted here I think.

answered 22 Mar '15, 13:41

iii's gravatar image

iii
4.9k84082
accept rate: 10%

edited 22 Nov '18, 22:46

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866