geocoder-php / geocoder-php/Geocoder
[OpenCage] configure guessing order
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- PHP
- Star
- 4k
- Fork
- 525
- Merge trung bình
- 8 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách so sánh thứ tự địa phương trong conf/countries/worldwide.yaml với mã sử dụng mảng $localityKeys. Hãy cho phép cấu hình thứ tự phỏng đoán mà không làm mất hành vi riêng theo từng quốc gia, đồng thời xác minh rằng ví dụ sẽ xác định Sankt Augustin thay vì Rhein-Sieg-Kreis là thành phố.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- php
- Lĩnh vực
- backend
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100