雅虎YQL地理编码不返回PHP国家


Yahoo YQL geoCode not returning country in php

我们正在使用Yahoo YQL地理代码查找器来查找使用纬度和经度的国家代码。

以下是使用的网址,

http://query.yahooapis.com/v1/public/yql?q=select+*+from+geo.placefinder+where+text+%3D+%2751.5073509%2C+-0.12775829999998223%27+and+gflags%3D%27R%27+&format=json

它以前可以工作,但突然停止提供国家/地区代码。

以下是给出的结果,

{"query":{"count":0,"created":"2016-02-11T06:35:28Z","lang":"en-US","results":null}}

请帮助我找到解决方案。

问候

内哈

检查雅虎控制台。我找不到表格的任何参考geo.placefinder

是否确定使用的是正确的 API 和正确的参数。

我运行了地理位置查询

select * from geo.places where text= "SFO"

http://query.yahooapis.com/v1/public/yql?q=select+*+from+geo.places+where+text+=+%27SFO

这给了我以下结果

{"query":{"count":

1,"created":"2016-02-11T08:09:34Z","lang":"en-US","results":{"place":{"lang":"en-US","xmlns":"http://where.yahooapis.com/v1/schema.rng","yahoo":"http://www.yahooapis.com/v1/base.rng","uri":"http://where.yahooapis.com/v1/place/12521721","woeid":"12521721","placeTypeName":{"code":"14","content":"Airport"},"name":"San 弗朗西斯科国际机场 机场","国家":{"代码":"美国","类型":"国家","woeid":"23424977","内容":"美联航 State"},"admin1":{"code":"US-CA","type":"State","woeid":"2347563","content":"California"},"admin2":{"code":","type":"County","woeid":"12587707","content":"San Francisco"},"admin3":null,"locality1":{"type":"Town","woeid":"2487956","content":"San Francisco"},"locality2":null,"postal":{"type":"Zip Code","woeid":"12797178","content":"94128"},"centroid":{"latitude":"37.62207","longitude":"-122.383659"},"boundingBox":{"SouthWest":{"latitude":"37.603939","longitude":"-122.403732"},"northEast":{"latitude":"37.64463","longitude":"-122.35482"}},"areaRank":"1","popRank":"1","timezone":{"type":"time Zone","woeid":"56043663","content":"America/Los_Angeles">

}}}}}

抱歉格式很硬,我无法让标签按照我想要的方式工作。

https://developer.yahoo.com/yql/console/#h=SELECT+*+FROM+geo.places+WHERE+text%3D%2251.5073509%22

我找到了一个在我的情况下工作正常的解决方案。

雅虎API服务不适用于查询格式,因此我使用了以下格式。

http://gws2.maps.yahoo.com/findlocation?q=51.5073509%2C%20-0.12775829999998223&gflags=R&format=json

问候

内哈