Get Weather information using Yql query lat,long parms
-
14-11-2019 - |
Question
I am using the following YQL query to get weather information
Is there any way to get weather information using longitude, latitude as YQL query parameter.
Solution
You could use a sub-select to go from a latitude/longitude pair to a WOEID like
SELECT * FROM weather.woeid
WHERE w IN (
SELECT place.woeid
FROM flickr.places(1)
WHERE (lat,lon) in (55.948503,-3.198931)
);
OTHER TIPS
This works for me:
...
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());
I have found some thing use ful; if you need to forcast weather yql use the SELECT * FROM weather.bylocation WHERE location='Indonesia' select * from weather.forecast where location=90210
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow