It is currently March 28th, 2024, 6:25 pm

free open geocoding apis

Tips and Tricks from the Rainmeter Community
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: free open geocoding apis

Post by moshi »

moshi wrote: but the Yahoo! api returns Rostock instead of Stockholm, other apis like Yandex or Google work fine. somehow Yahoo! seems to shuffle the letters. :?
i think i know why this happens. other geocoding services do have the Russian (or Bulgarian, etc.) names in their database in Cyrillic. Yahoo! does not and probably transcribes the Cyrillic letters to the Latin alphabet, results are rather mixed.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: free open geocoding apis

Post by moshi »

jsmorley wrote:Looks like the api doesn't support it, but what would be really cool would be to enter a Lat/Long and have it "find" the nearest valid weather location code. Sometimes the closest "town/city" seems like it should be correct, but many folks could get even more accurate weather results since there are actually defined locations Yahoo knows about that are not intuitive to the user. For instance, my mailing address is "Fairfax", but "Chantilly" works better for accurate weather.

Lat and Long most folks can get from their phones...
if you are still interested in this you might want to have a look at the OpenWeatherMap api, they recently added that: http://openweathermap.org/API

now get me a Rainmeter plugin that returns the coordinates from a GPS sensor. i might grab a Surface Pro when the firesale starts :)
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: free open geocoding apis

Post by moshi »

as an addition to this thread, YQL's geo.concordance table is nice when you need a GeoNames id, Wikipedia article id, FIPS id, etc

the YQL console code should look like this:
http://developer.yahoo.com/yql/console/

Code: Select all

select * from geo.concordance where namespace="woeid" and text in (select woeid from geo.places(0,1) where text="London")
this will return a GeoNames id of 2643743 which is used in the BBC weather feeds for example:
http://open.live.bbc.co.uk/weather/feeds/en/2643743/observations.rss

or a Wikipedia id of 17867:
https://en.wikipedia.org/w/index.php?curid=17867
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: free open geocoding apis

Post by moshi »

jsmorley wrote:Looks like the api doesn't support it, but what would be really cool would be to enter a Lat/Long and have it "find" the nearest valid weather location code. Sometimes the closest "town/city" seems like it should be correct, but many folks could get even more accurate weather results since there are actually defined locations Yahoo knows about that are not intuitive to the user. For instance, my mailing address is "Fairfax", but "Chantilly" works better for accurate weather.

Lat and Long most folks can get from their phones...

Code: Select all

select * from yahoo.maps.findLocation where q="38.8942786,-77.4310992" and gflags="R"
:)
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: free open geocoding apis

Post by moshi »

or even better:

Code: Select all

select * from weather.forecast where woeid in (select ResultSet.Results.woeid from yahoo.maps.findLocation where q="38.8942786,-77.4310992" and gflags="R") and u="f"

Code: Select all

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20ResultSet.Results.woeid%20from%20yahoo.maps.findLocation%20where%20q%3D%2238.8942786%2C-77.4310992%22%20and%20gflags%3D%22R%22)%20and%20u%3D%22f%22&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
Last edited by moshi on February 17th, 2014, 10:55 am, edited 1 time in total.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: free open geocoding apis

Post by moshi »

this is just something i did using an example for the Yandex Maps API. maybe somebody familiar with Javascript could add WOEID finding capabilities.
screenshot-Internet Explorer (Microsoft (R)-HTML-Anwendungshost) [mshta]-17.02.2014 , 11_42_05-001.png
CoordinatesFinder.zip
(1.44 KiB) Downloaded 119 times
Post Reply