ITADN

handler_for_filtered not behaving as expected.

#293Closedknaveofdiamonds 创建于 2025-05-22
K
knaveofdiamondscommented
If I have code like the following: ``` writer = osmium.SimpleWriter(output_pbf, overwrite=True) fp = osmium.FileProcessor(input_pbf).with_filter( osmium.filter.IdFilter([1,2,3]).enable_for(osmium.osm.WAY) ).with_filter( osmium.filter.IdFilter([1,2,3]).enable_for(osmium.osm.NODE) ).handler_for_filtered(writer) for o in fp: # ... process nodes and ways ``` I would have expected that the relations would just get passed through to the output via the `handler_for_filtered` method, however this is not the case. I need to add something with a filter that filters everything in order to get them to show, like: ``` with_filter( osmium.filter.IdFilter([-1]).enable_for(osmium.osm.RELATION) ) ``` This feels unexpected - is this a bug, or intended, or am I just missing passing a parameter somewhere? If intended is it possible to configure this behavior, so you don't need to add spurious filters?
关闭于 2025-05-22 4 条评论