osmium-tool icon indicating copy to clipboard operation
osmium-tool copied to clipboard

tags-filter --omit-referenced removing results that matches filter

Open edfungus opened this issue 6 months ago • 1 comments

What version of osmium-tool are you using?

v1.18.0

What operating system version are you using?

arm64v8/alpine:latest

Tell us something about your system

Local docker 4gb

What did you do exactly?

  1. I downloaded this dataset https://download.geofabrik.de/north-america/us/california/norcal.html
  2. Extracted a subset of the data with /usr/local/bin/osmium extract -b -122.514900,37.708100,-122.354900,37.811800 --overwrite /tmp/central/build/osm/norcal-latest.osm.pbf -o /tmp/central/build/osm/norcal-latest-sf.osm.pbf
  3. Then tried to filter items that are park related with /usr/local/bin/osmium tags-filter /tmp/central/build/osm/norcal-latest-sf.osm.pbf --omit-referenced --overwrite -o /tmp/central/build/osm/norcal-latest-sf-parks.osm.pbf leisure=park leisure=garden leisure=nature_reserve leisure=playground landuse=recreation_ground
  4. I also tried to filter without --omit-referenced
  5. Then exported to geojsonseq to inspect

What did you expect to happen?

When --omit-referenced was not included I would get Golden Gate Park as a result

{"type":"Feature","geometry":{"type":"LineString","coordinates":[...]},"properties":{"ele":"70","gnis:feature_id":"224295","leisure":"park","localwiki":"sf/Golden Gate Park","name":"Golden Gate Park","name:kn":"ಗೋಲ್ಡನ್ ಗೇಟ್ ಪಾರ್ಕ್","name:ko":"골든게이트 공원","name:zh":"金門公園","start_date":"1870","wikidata":"Q635559","wikimedia_commons":"Category:Golden_Gate_Park","wikipedia":"en:Golden Gate Park"}}

It has "leisure":"park", so that was expected. When I added --omit-referenced, I would still expect Golden Gate Park to be in the results.

What did happen instead?

Golden Gate Park was not in the results with --omit-referenced.

What did you do to try analyzing the problem?

I went through the docs https://docs.osmcode.org/osmium/latest/osmium-tags-filter.html and https://osmcode.org/osmium-tool/manual.html. First time using this so maybe my understanding is wrong? Seems pretty fundamental usage of the tool so maybe there is something I'm missing here

edfungus avatar Jul 06 '25 07:07 edfungus

Presumably the Golden Gate Park is mapped as a way, if you add --omit-referenced you'll not get the nodes referenced by that way, which means you don't get the geometry of that way which means it can't be in the JSON output. Please read about how the OSM data model works, without understanding that, you can't really understand what is happening here.

joto avatar Jul 06 '25 11:07 joto