googlemaps / googlemaps/google-maps-services-python

PlaceAutocompletePrediction results have missing fields

未關閉
#424 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
triage me type: bug
主要語言
Python
星號
5k
分支
1.4k
PR 合併指標
30 天內沒有已合併 PR

描述

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"
]
}
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。