[OSM-dev] Quick way to remove specific nodes/ways/relations with osmium?
Jochen Topf
jochen at remote.org
Thu Mar 11 22:03:46 UTC 2021
On Thu, Mar 11, 2021 at 04:26:50PM -0500, Craig Durkin wrote:
> Ah, good idea! My backup plan was to create a fake OSM changeset file to
> apply to PBF tiles to tag every way I wanted to remove with a "deleted=yes"
> tag or somesuch, so that I could then filter them with "osmium
> tags-filter". Your way seems simpler :)
Hm. Interesting idea. But it should be possible to make this even
easier: Generate a change file that contains deletes for all the ways
you want to delete, then apply the change.
Say you have a file with all way ids to delete, one per line. Then you
can do something like this (untested):
sed -i -e 's/^/w/' -e 's/$/ v999999 dD' IDFILE >delete.osc
osmium apply-changes ORIG.osm.pbf delete.osc -o OUT.osm.pbf
Jochen
--
Jochen Topf jochen at remote.org https://www.jochentopf.com/ +49-351-31778688
More information about the dev
mailing list