Allow joining external data using tag-transform #52
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.
Overview
In order to join per-postal-code data from a CSV file, I extended tag-transform to be able to read a row of data from a generic DataSource object and insert this data into the output tag using the new data and source elements along with two new attributes on the tag element in the output section.
Functionality
For an example, please refer to the test below: The
postal_code
field is matched and looked up in the CSV file (column 0). From this, a tag is generated, with its value set to "5000".Current state
It's basically functional and does not appear to noticeably degrade performance on smaller data sets (tested on[1]) and does nothing if not configured explicitly.
If you're interested in merging this work, I'd appreciate some feedback! I'm not quite sure about formatting/indentation,
./gradlew checkstyleMain checkstyleTest
does not seem to catch all issues for some reason. Docs are still missing, too.[1] https://download.openstreetmap.fr/extracts/europe/germany/nordrhein_westfalen/munster.osm.pbf