Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Filter handler can be used to drop irrelevant OSM objects before they are handed into Python callbacks, thus significantly speeding up processing. They can be either used with apply (order matters!):
or handed into the apply_file/buffer functions of the SimpleHandler:
The latter has the advantage that it will correctly work together with the location cache and area handling.
Filters are always implemented in C++. Allowing filters to be defined in Python would defy the purpose of avoiding callbacks into Python. There are two filters defined right now:
Processing a Switzerland extract with the EmptyTagFilter reduces processing time from 40s to 6s.