雅虎!Geo Technologies 很高兴地宣布在 YQL 中提供 PlaceFinder 支持。geo.placefinder 表允许用户通过 YQL 查询向 PlaceFinder 发出请求。新表提供了几种访问 PlaceFinder 的不同方式。可以使用http://query.yahooapis.com/v1/public/yql?q...&appid=test检索支持的请求和参数的描述。这里有一些例子:
使用自由格式输入格式对街道地址(1600 Pennsylvania Ave, Washington, DC)进行地理编码:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%221600%20Pennsylvania%20Ave%2C%20Washington%2C%20DC%22&appid=test
使用多行输入格式对街道地址(701 First Ave, Sunnyvale, CA 94089)进行地理编码:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20line1%3D%22701%20First%20Ave%22%20and%20line2%3D%22Sunnyvale%2C%20CA%2094089%22&appid=test
对机场代码 (SFO) 进行地理编码:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%22sfo%22&appid=test
用法语对兴趣点 (POI) 进行地理编码:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%22Eiffel%20Tower%22%20and%20lang%3D%22fr%22&appid=test
使用地理坐标进行反向地理编码:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%2237.416275%2C%20-122.025092%22%20and%20gflags%3D%22R%22&appid=test
使用解析的输入格式对街道地址(701 First Ave, Sunnyvale, CA 94089)进行地理编码:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20house%3D%22701%22%20and%20street%3D%22First%20Ave%22%20and%20city%3D%22Sunnyvale%22%20and%20state%3D%22CA%22%20and%20postal%3D%2294089%22&appid=test
确定地址的最近十字路口和时区:
http://query.yahooapis.com/v1/public/yql?q=select%20line1%2C%20line2%2C%20line3%2C%20line4%2C%20cross%2C%20timezone%20from%20geo.placefinder%20where%20text%3D%22701%20First%20Ave%2C%20Sunnyvale%2C%20CA%22%20and%20flags%3D%22T%22%20and%20gflags%3D%22C%22&appid=test
此示例说明 YQL 仅从响应中选择指定字段的能力