views:

125

answers:

2

Hi all,

I'm trying to use Yahoo's excellent GeoPlanet API: http://developer.yahoo.com/geo/geoplanet/guide/api-reference.html

I would like to pick a random town from anywhere in the world but can't see an easy way to do it. I have tried querying by country and asking for children of type 'town', but can't seem to do that directly.

Can anyone think of a way to pluck out a random town WOEID without having to query the country, then the admin regions, then the admin 2, then the admin 3 etc.

I have also experimented using YQL, but don't have enough of an understanding about the available APIs.

+2  A: 

Have a look at http://world-gazetteer.com/. You can store all towns in your local database, then do random select, and then just geocode selected town using any geocode service you like.

vooD
This sounds like a good backup plan if I can't find a 'proper' API to do it. Thanks.
Dan Forys
+1  A: 

Just for phun, why not generate random lat/long & display whatever is there?

Mawg
Most of the world isn't a town, to name the most obvious reason.
MSalters
Yes, sorry, this won't be reliable. I need to do it in as few calls as possible; trial and error isn't what I'm looking for.
Dan Forys