使用Yahoos API获得Lat,Long的WOEID

cho*_*ise 18 api yahoo latitude-longitude

我搜索了一段时间但没有发现任何东西,这与我的问题相似.

我正在尝试使用YAHOO Weather API,例如:http://weather.yahooapis.com/forecastrss?w = 4097

在我的情况下,我不知道WOEID,但我得到了纬度和经度点.

所以我的问题是:有没有办法通过使用纬度和长点获得一个地方的WOEID?

Mat*_*ndh 18

现在可以通过最近发布的PlaceFinder API获得.感谢雅虎!提供Geo拼图的另一个重要部分.


Ahm*_*dal 11

雅虎 PlaceFinder API允许您为纬度/经度对找到相应的WOEID.考虑这个示例Web服务方法调用:

http://where.yahooapis.com/geocode?location=37.42,-122.12&flags=J&gflags=R&appid=zHgnBS4m
Run Code Online (Sandbox Code Playgroud)

您可以根据需要使用请求参数,请参阅Yahoo! PlaceFinder API文档了解更多信息.你应该用你的雅虎取代appid!appid,你可以在这里创建一个.

此请求返回类似的响应,其中包含许多有用的数据以及WOEID:

{
    "ResultSet": {
        "version": "1.0",
        "Error": 0,
        "ErrorMessage": "No error",
        "Locale": "us_US",
        "Quality": 99,
        "Found": 1,
        "Results": [
            {
                "quality": 99,
                "latitude": "37.420000",
                "longitude": "-122.120000",
                "offsetlat": "37.420000",
                "offsetlon": "-122.120000",
                "radius": 500,
                "name": "37.42,-122.12",
                "line1": "3589 Bryant St",
                "line2": "Palo Alto, CA  94306-4207",
                "line3": "",
                "line4": "United States",
                "house": "3589",
                "street": "Bryant St",
                "xstreet": "",
                "unittype": "",
                "unit": "",
                "postal": "94306-4207",
                "neighborhood": "",
                "city": "Palo Alto",
                "county": "Santa Clara County",
                "state": "California",
                "country": "United States",
                "countrycode": "US",
                "statecode": "CA",
                "countycode": "",
                "hash": "",
                "woeid": 12797284,
                "woetype": 11,
                "uzip": "94306"
            }
        ]
    }
}
Run Code Online (Sandbox Code Playgroud)

  • 这个API是否已停止?现在它返回:D/StandardLauncher(11881):<title> Yahoo!天气 - 错误</ title> D/StandardLauncher(11881):<description> Yahoo!天气错误</ description> D/StandardLauncher(11881):<item> <title>未找到城市</ title> <description> D/StandardLauncher(11881):输入/预测器无效?w = null&amp; u = c D/StandardLauncher(11881):</ description> </ item> </ channel> </ rss> D/StandardLauncher(11881):<! - api5.weather.sg3.yahoo.com Wed Apr 3 02:45:25 PST 2013 - > (6认同)

sal*_*cer 8

这不是使用雅虎的API,但我发现这篇博文:http: //geomojo.org/?p = 38

提及此服务:http://www.geomojo.org/cgi-bin/reversegeocoder.cgi? long = -117.699444&la = 35.4775

也许你可以使用它?它解决了我的问题,我希望它有助于解决你的问题.

  • 上面提到这两个网站都不起作用.显示消息"您尝试访问的网站暂时无法使用." (2认同)