googlemaps / googlemaps/google-maps-services-python

PlaceAutocompletePrediction results have missing fields

Đang mở
#424 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage me type: bug
Ngôn ngữ chính
Python
Star
5k
Fork
1.4k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The `PlaceAutocompletePrediction` results have missing fields for the input string:

`"Holiday Inn Airport Frankfurt Main"`

the first result I get is for:

`Holiday Inn Frankfurt Airport, an IHG Hotel, Bessie-Coleman-Straße, Frankfurt, Germany`

although having overlapping strings the first `PlaceAutocompletePrediction` entry has

`matched_substrings` = []
`structured_formatting` is missing the entry `main_text_matched_substrings` which is in the documentation is defined as `required`

#### Code example

```python
import requests

url = "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=\"Holiday Inn Airport Frankfurt Main\"&key=XXXXXXXXXXXXXX"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

```

---

Full response for the first entry:

```
{
"description": "Holiday Inn Frankfurt Airport, an IHG Hotel, Bessie-Coleman-Straße, Frankfurt, Germany",
"matched_substrings": [

],
"place_id": "ChIJKZCkquYKvUcRhHkfAHT9CKo",
"reference": "ChIJKZCkquYKvUcRhHkfAHT9CKo",
"structured_formatting": {
"main_text": "Holiday Inn Frankfurt Airport, an IHG Hotel",
"secondary_text": "Bessie-Coleman-Straße, Frankfurt, Germany"
},
"terms": [
{
"offset": 0,
"value": "Holiday Inn Frankfurt Airport, an IHG Hotel"
},
{
"offset": 45,
"value": "Bessie-Coleman-Straße"
},
{
"offset": 68,
"value": "Frankfurt"
},
{
"offset": 79,
"value": "Germany"
}
],
"types": [
"lodging",
"point_of_interest",
"establishment"
]
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.