geocoder-php / geocoder-php/Geocoder

[OpenCage] configure guessing order

Aperta
#1,111 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
PHP
Stelle
4k
Fork
525
Merge medio
8m
PR unite (30g)
1

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia confrontando l’ordine delle località in conf/countries/worldwide.yaml con il codice che usa l’array $localityKeys. Rendi configurabile l’ordine dei tentativi senza perdere il comportamento specifico di ciascun paese e verifica che l’esempio risolva Sankt Augustin invece di Rhein-Sieg-Kreis come città.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php
Ambito
backend
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.