geocoder-php / geocoder-php/Geocoder
[OpenCage] configure guessing order
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- PHP
- Sterne
- 4k
- Forks
- 525
- Ø Merge
- 8 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Reihenfolge der Ortsangaben in conf/countries/worldwide.yaml mit dem Code zu vergleichen, der das Array $localityKeys verwendet. Mache die Reihenfolge der Vermutungen konfigurierbar, ohne das länderspezifische Verhalten zu verlieren, und überprüfe, dass das Beispiel Sankt Augustin und nicht Rhein-Sieg-Kreis als Stadt auflöst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- php
- Bereich
- backend
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100