擅长:python、mysql、java
<p>它也可以在列表“address_components”【Country->;State->;Country->;…】中使用Google API:</p>
<pre><code>request(
'http://maps.googleapis.com/maps/api/geocode/json', 'GET', {
'address': 'Chicago Illinois'
'language': 'en',
'sensor': 'true'
}
)
</code></pre>
<p>如果第一个列表中的变量太多,则必须定义适当的long/lat:</p>
<pre><code>request(
'http://maps.googleapis.com/maps/api/geocode/json', 'GET', {
'latlng': "${Latitude},${Longitude}",
'language': 'en',
'sensor': 'true'
}
)
</code></pre>
<p>另一个示例,Yahoo API:</p>
<pre><code>request('https://query.yahooapis.com/v1/public/yql', 'GET', {
'q': "select * from geo.places.parent where child_woeid in (select woeid from geo.places where text='Chicago, Illinois')",
'market': 'en-gb',
'format': 'json',
'env': 'store%3A%2F%2Fdatatables.org%2Falltableswithkeys',
'callback': ''
})
</code></pre>
<p>假设,同样的方法可以直接用于任何GEO API。</p>