2016-02-05 115 views
6

我想通過使用雅虎查詢獲取經緯度的一些天氣數據。但似乎這個查詢現在不可用。查詢如下:雅虎經緯度天氣查詢

select * from weather.forecast where woeid in (SELECT woeid FROM geo.placefinder WHERE text="{lat},{lon}" and gflags="R") 

是此查詢更改爲新的或什麼?或者它不再存在?上次我使用這種格式大約2個月前,它運行良好。但現在它無法獲取任何數據。從YQL控制檯結果如下:

{ 
"error": { 
    "lang": "en-US", 
    "description": "Tenant 'query_yahooapis_com' access to 'Resource [tenantName=query_yahooapis_com, type=TABLE, name=geo.placefinder, locatorType=FILE, url=/home/y/share/manhattan/application/tenantBundles/yql_query_yahooapis_com_manhattan_v2/YQL-INF/restdefs/geo.placefinder.xml, useUrl=false]' is denied." 
} 
} 

我已經做了一些研究,包括這個帖子:How to get Yahoo's woeid by location?

是真的,雅虎已經終止獲取天氣這個經緯度查詢?

回答

16

根據最新回覆this answer,您應該切換到表geo.places並刪除gflags="R"部分。 我試過它在YQL控制檯,它似乎工作:

select * from weather.forecast where woeid in (SELECT woeid FROM geo.places WHERE text="(latitude,longitude)") 
+0

嗨。感謝您的回覆。但似乎你的答案仍然產生相同的結果。我真的認爲這個查詢不再有效。 –

+0

它不會產生相同的結果。我不知道你是如何嘗試的,但我只是嘗試過,一切正常。 [看看這裏,只需按下測試按鈕](https://developer.yahoo.com/yql/console/#h=select+*+from+weather.forecast+where+woeid+in+(SELECT + woeid + FROM + geo.places + WHERE + text%3D%22%7Blat%7D%2C%7Blon%7D%22)) – greg

+0

我可以知道,您放置的確切位置,我的意思是您使用的經度和緯度對於這個查詢?是的,我已經嘗試過你的測試,它工作。但似乎你只在查詢中加入'lat'和'lon'。 –