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

Obtaining a list of items with “tag x but not tag y”

1

I can obtain a list of items with a combination of two tags using the XAPI as follows:

wget http://jxapi.openstreetmap.org/xapi/api/0.6/*[amenity=pub][source=*][bbox=-0.645,52.756,-0.595,52.856]

but is it possible to obtain a list of "tag X but not tag Y" (using either XAPI, or Overpass, or something else)?

asked 09 Oct '11, 13:20

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%


One Answer:

2

Seems like you could use Osmfilter after downloading a .osm file to drop elements with specific tags. I never used it though.

answered 09 Oct '11, 14:27

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

Thanks - that was exactly what I was looking for.

(09 Oct '11, 18:01) SomeoneElse ♦

Source code available on GitHub .