geocoder-php / geocoder-php/Geocoder

[OpenCage] configure guessing order

オープン
#1,111 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
PHP
スター
4k
フォーク
525
平均マージ
8分
マージ済み PR(30日)
1

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、conf/countries/worldwide.yaml の地域の順序と、$localityKeys 配列を使用するコードを比較します。国ごとの動作を失わずに推測順を設定可能にし、例で Rhein-Sieg-Kreis ではなく Sankt Augustin が市として解決されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
backend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。