2016-01-20 118 views
3

当我尝试使用gFlags进行查询时,使用Yahoo YQL不会返回任何结果。 https://developer.yahoo.com/yql/console/?debug=true#h=select+从+ geo.placefinder * + + +其中文本%3D%2237.416275%2C-122.025092%22 +和+ GFLAGS%3D'R”使用gFlags的Yahoo YQL查询不会返回任何内容

响应:

<?xml version="1.0" encoding="UTF-8"?> 
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" 
    yahoo:count="0" yahoo:created="2016-01-20T16:07:28Z" yahoo:lang="en-US"> 
    <diagnostics> 
     <publiclyCallable>true</publiclyCallable> 
     <url execution-start-time="16" execution-stop-time="21" 
      execution-time="5" http-status-code="503" http-status-message="Service Unavailable"><![CDATA[http://gws2.maps.yahoo.com/findlocation?pf=1&locale=en_US&offset=15&flags=&q=37.416275%2c-122.025092&gflags=R&start=0&count=100]]></url> 
     <user-time>22</user-time> 
     <service-time>5</service-time> 
     <build-version>0.2.376</build-version> 
    </diagnostics> 
    <results/> 
</query> 

当我删除GFLAGS,有一个成功的结果。例如: https://developer.yahoo.com/yql/console/?debug=true#h=select+ * + +从+ geo.placefinder其中+文本%3D%2237.416275%2C-122.025092%22

我需要使用GFLAGS访问WOEID属性(从POI,根据文档:https://developer.yahoo.com/boss/geo/docs/free_YQL.html

+2

我注意到,即使在雅虎的YQL测试控制台中,这也被破坏了,但是,响应中有一个503不可用状态: “url”:{ “execution-start-time”:“1”, “execution-停止时间“:”7“,” “执行时间”:“6”, e“:”服务不可用“, ”content“:”http://gws2.maps.yahoo.com/findlocation?pf=1&locale=zh_CN&offset=15&flags=&q=37.416275%2c-122.025092&gflags=R&start=0&count=100 “ } –

+0

哦,现在感觉了。我试图从API中找到一个“状态页面”,但似乎没有。 –

回答

1

昨天玩了很多游戏之后,我发现geo.placefinder表不会返回任何东西,但是geo.places表格却可以。因此,您可以将您的查询更改为“select * from geo.places(1)where ...”请注意结果格式稍有不同。

此外,我注意到,当传递经纬度时,一定要在其周围包括括号。例如。文本=“(111.11111,222.22222)”

因此,要与工作的地方重新发布您的原始查询(通知没有更多的GFlags在参数和周围的纬度/经度括号):

https://developer.yahoo.com/yql/console/?debug=true#h=select+*+from+geo.places(1)+where+text%3D%22(37.416275%2C-122.025092)%22

2

对我来说,现在可以正常工作的查询返回null。看起来,从yahoo服务器内部调用来从纬度/经度中撤回wooid不成功。然而,这种调用工作从我的机器罚款:

http://gws2.maps.yahoo.com/findlocation?pf=1&locale=en_US&offset=15&flags=&q=48.136757%2c-1.622015&gflags=R&start=0&count=100

所以,一个解决方法是先调用findLocation服务,然后,用WOEID,拨打气象服务。试过今天,工作正常。

+0

这个API现在正在工作,但我认为它将在某一天被弃用。 – hoi

相关问题