雅虎经纬度天气查询

问题描述:

我想通过使用雅虎查询获取经纬度的一些天气数据。但似乎这个查询现在不可用。查询如下:雅虎经纬度天气查询

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?

是真的,雅虎已经终止获取天气这个经纬度查询?

根据最新回复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'。 –