Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yahoo YQL: find city WOEID by coordinates

Tags:

yql

yahoo-api

How to get city's WOEID if I know latitude and longitude of city using YQL?

like image 588
Ivan Bajalovic Avatar asked May 23 '12 07:05

Ivan Bajalovic


2 Answers

For those still trying to look up the WOEID by coordinates, the other answers are now outdated. Use the geo.placefinder datatable to look up the latitude and longitude, and the WOEID will be in the returned results.

Via YQL:

SELECT * FROM geo.placefinder WHERE text="{$seedLat}, {$seedLon}" and gflags="R"

(Test it out on the YQL Console.)

Via REST:

http://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20geo.placefinder%20WHERE%20text%3D%22{$seedLat}%2C{$seedLon}%22%20and%20gflags%3D%22R%22
like image 127
shshaw Avatar answered Sep 30 '22 06:09

shshaw


You can reference the official web page: http://developer.yahoo.com/boss/geo/docs/free_YQL.html

Here is an exmpale: select * from geo.placefinder where text="37.416275,-122.025092" and gflags="R"

like image 20
Chuanyung Lin Avatar answered Sep 30 '22 08:09

Chuanyung Lin