Yahoo Weather Query by Latitude and Longitude

前端 未结 2 1648
迷失自我
迷失自我 2021-02-02 02:34

I want to fetch some weather data via latitude and longitude using yahoo query. but it seems this query is not available now. the query is below:

select * from w         


        
2条回答
  •  醉酒成梦
    2021-02-02 02:44

    This works for me(you should switch to the table geo.places(1)):

    ...

    query = "SELECT * FROM weather.forecast " +
                "WHERE woeid in (" +
                "SELECT woeid " +
                "FROM geo.places(1) " +
                "WHERE text=\"(%1$s,  %2$s)\") " +
                "AND u='c'";
    

    ... and then:

    query = String.format(query, location.getLatitude(), location.getLongitude());
    

提交回复
热议问题