Yahoo YQL: Find WOEID City by Coordinates

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

+5
source share
5 answers

Using the YQL console, you can find the closest place with "placeTypeName.code" of 7

http://developer.yahoo.com/yql/console/

SELECT * FROM geo.places WHERE text="{$seedLat}, {$seedLong}" AND placeTypeName.code = 7

The REST request for this request will look something like this:

http://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20geo.places%20WHERE%20text%3D%22{$seedLat}%2C%20{$seedLong}%22%20AND%20placeTypeName.code%20%3D%207&format=json&diagnostics=true&callback=

Obviously replacing $seedLatwith $seedLongyour own coordinates :)

+1
source

For those who are still trying to find the WOEID by coordinates, the remaining answers are now out of date. Use geo.placefinderdatatable to search for 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"

( Check it out on the YQL console .)

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
+8

-: http://developer.yahoo.com/boss/geo/docs/free_YQL.html

: * from geo.placefinder, text = "37.416275, -122.025092" gflags = "R"

+2

, Yahoo geo.placefinder , , OAuth (. Free Non-commercial YQL). WOEID , geo.places:

select * from geo.places where text="Hanover, PA" AND placeTypeName.code = 7

YQL

, WOEID data.query.results.place.woeid.

. ( ) , "" ( , ). . , /, boundingBox:

select * from geo.places where text="Eagle, Wisconsin" AND
  boundingBox.southWest.latitude <= 42.9147280 AND
  boundingBox.southWest.longitude <= -88.4426340 AND
  boundingBox.northEast.latitude >= 42.9147280 AND
  boundingBox.northEast.longitude >= -88.4426340 AND
  placeTypeName.code = 7

YQL

(text - ), , , , .

+2

None of the previous answers work anymore, but it works.

You need to combine the flicker table in the query as follows: select place.woeid from flickr.places where lat="" and lon="" and api_key=""

Getting the API key from Flickr happens instantly: https://www.flickr.com/services/apps/create/

0
source

All Articles