Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenCage] configure guessing order #1111

Open
eschricker opened this issue Jan 21, 2021 · 0 comments
Open

[OpenCage] configure guessing order #1111

eschricker opened this issue Jan 21, 2021 · 0 comments

Comments

@eschricker
Copy link

It would be great, if the guessing order could be configured instead of being hard coded.

For example for this result in Germany: '53757, Sankt Augustin, Grantham Allee 20, Deutschland' the returned components are:

"components": {
        "ISO_3166-1_alpha-2": "DE",
        "ISO_3166-1_alpha-3": "DEU",
        "_category": "commerce",
        "_type": "shop",
        "city": "Rhein-Sieg-Kreis",
        "continent": "Europe",
        "country": "Deutschland",
        "country_code": "de",
        "county": "Rhein-Sieg-Kreis",
        "house_number": "20",
        "political_union": "European Union",
        "postcode": "53757",
        "road": "Grantham-Allee",
        "shop": "Druckpunkt",
        "state": "Nordrhein-Westfalen",
        "state_code": "NW",
        "suburb": "Mülldorf",
        "town": "Sankt Augustin"
      }

Due to the current locality order 'Rhein-Sieg-Kreis' will be returned as city, but 'Sankt Augustin' would be correct. In comparison to the formatted field of the OpenCage-result "Druckpunkt, Grantham-Allee 20, 53757 Sankt Augustin, Deutschland" where the city is set properly.

https://github.com/OpenCageData/address-formatting/blob/master/conf/countries/worldwide.yaml

shows different orders depending for different countries.

In my opinion a simple solution could be to make the $localityKeys array public and static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant