Add original place id when postalcode is overridden #1635
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.
👋 I did some awesome work for the Pelias project and would love for everyone to have a look at it and provide feedback.
Here's the reason for this change 🚀
Addresses from OpenAddresses can override parent place name (such as
postalcode
). When this happens, we don't know where the postalcode came from, especially if there was one from another source (like WOF).Also, since postalcodes are part of an document's parents, not having a gid makes the API less consistent.
Here's what actually got changed 👏
In
renamePlacenames
middleware, I added an option that allows us to add/override the postalcode gid. Thanks to this, we will know where the data comes from.Here's how others can test the changes 👀
You can try with
815 Tennessee St, San Francisco, CA 94107, États-Unis
where thepostalcode_gid
will beopenaddresses:address:us/ca/san_francisco:819b088d2837cf5d
Maybe when the postalcode is already present in the parent object we may not override it with OA data ?
Feel free the close the PR if this is not valuable for the project 😄