-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(abbreviations): Use 3-character country code for dependencies wh…
…ere possible After pelias/api#1622, which extends the `boundary.country` API parameter to include the `depencency` placetype, we noticed that venue and address records often have a 2-character country code when they are part of a dependency. The `boundary.country` parameter currently checks only for 3-character codes, and so the best solution is to ensure the relevant property on all records in Elasticsearch is a 3-character country code whenever possible. This change expands on the logic for selecting an abbreviation for an admin record to be used for point in polygon lookup. Logic specific to countries is expanded to include dependencies, and some additional possible fields that might contain 3-character codes are checked. Because the abbreviaton logic is now a bit more substantial, it's extracted into its own function. It's also been made a bit less redundant and hopefully more clear.
- Loading branch information
1 parent
791dd52
commit 3c68485
Showing
2 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters