Google Geocode возвращает адрес Wring - PullRequest
0 голосов
/ 11 марта 2020

Я использую API геокодирования Google, и результаты, которые я получаю, почти всегда точны, за исключением случаев, когда они не соответствуют действительности. Например, URL: https://maps.google.com/maps/api/geocode/xml?sensor=false&key=mykey&address=107%20Vandiver%20Rd%20Lot#13, Allenhurst, GA, 31301 возвращает совершенно другой район страны (указан ниже). Возвращается тот же адрес: 107 Vandiver Rd # 13 Allenhurst, GA 31301 на Картах Google. Любая идея относительно того, что я делаю неправильно?

Возвращает:

<GeocodeResponse>
<status>OK</status>
<result>
<type>premise</type>
<formatted_address>107 Vandiver Dr, Madison, TN 37115, USA</formatted_address>
<address_component>
<long_name>107</long_name>
<short_name>107</short_name>
<type>street_number</type>
</address_component>
<address_component>
<long_name>Vandiver Drive</long_name>
<short_name>Vandiver Dr</short_name>
<type>route</type>
</address_component>
<address_component>
<long_name>Madison</long_name>
<short_name>Madison</short_name>
<type>neighborhood</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Nashville</long_name>
<short_name>Nashville</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Davidson County</long_name>
<short_name>Davidson County</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Tennessee</long_name>
<short_name>TN</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>United States</long_name>
<short_name>US</short_name>
<type>country</type>
<type>political</type>
</address_component>
<address_component>
<long_name>37115</long_name>
<short_name>37115</short_name>
<type>postal_code</type>
</address_component>
<address_component>
<long_name>4242</long_name>
<short_name>4242</short_name>
<type>postal_code_suffix</type>
</address_component>
<geometry>
<location>
<lat>36.2632706</lat>
<lng>-86.6781400</lng>
</location>
<location_type>ROOFTOP</location_type>
<viewport>
<southwest>
<lat>36.2619304</lat>
<lng>-86.6795023</lng>
</southwest>
<northeast>
<lat>36.2646284</lat>
<lng>-86.6768044</lng>
</northeast>
</viewport>
<bounds>
<southwest>
<lat>36.2632156</lat>
<lng>-86.6782322</lng>
</southwest>
<northeast>
<lat>36.2633432</lat>
<lng>-86.6780745</lng>
</northeast>
</bounds>
</geometry>
<place_id>ChIJ_XkNqMtDZIgRQYGJVL6WQro</place_id>
</result>
</GeocodeResponse>

1 Ответ

0 голосов
/ 24 марта 2020

Вы не URL, кодирующий '#' в 'Лоте 13'

https://maps.google.com/maps/api/geocode/xml?sensor=false&key=mykey&address=107%20Vandiver%20Rd%20Lot%2313, Allenhurst, GA, 31301 будет работать нормально.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...