<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "How to use longitude/latitude to lookup country / timezone in allCountries.txt ?"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "How to use longitude/latitude to lookup country / timezone in allCountries.txt ?"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>How to use longitude/latitude to lookup country / timezone in allCountries.txt ?</title>
				<description><![CDATA[ Hi
I know geonames provides handy webservices for me to query , such as :
http://ws.geonames.org/timezone?lat=25.03&lng=121.3

But the service seems unreliable , sometimes un-connectable ...

I need a reliable service. 

So I download allCountries.zip and unzip it , and export all data to MySQL , totally 6914549 rows.

But I wonder if there is an efficient algorithm to lookup some location's country code and timezone ?

I have some idea , but it is very computing-intensive and impractical . 
How does ws.geonames.org/* services work ? Is there any algorithm ?

Thanks a lot.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1595.page#6621</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1595.page#6621</link>
				<pubDate><![CDATA[Thu, 5 Nov 2009 22:53:07]]> GMT</pubDate>
				<author><![CDATA[ smallufo]]></author>
			</item>
			<item>
				<title>Re:How to use longitude/latitude to lookup country / timezone in allCountries.txt ?</title>
				<description><![CDATA[ Hi

I'm similarly looking for a simple method call, like the GeoNames calls:

countryCode(lat,lon)
timezone(lat,lon)

without having to use the webservice.

Is there a siple way of doing this or has anyone else found analternative solution.

Thanks

Graham]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1595.page#6680</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1595.page#6680</link>
				<pubDate><![CDATA[Wed, 18 Nov 2009 13:26:14]]> GMT</pubDate>
				<author><![CDATA[ gmseed]]></author>
			</item>
			<item>
				<title>Re:How to use longitude/latitude to lookup country / timezone in allCountries.txt ?</title>
				<description><![CDATA[ Hi

I just downloaded the tzdata file from:

http://www.twinsun.com/tz/tz-link.htm

ftp://elsie.nci.nih.gov/pub/

and looked inside file "zone.tab", which lists the (lat,lon) for all of the country codes in "iso3166.tab".

The problem then reduces to finding the zone that a user specified (lat,lon) falls within.

I was thinking of building a kdtree of (lat,lon) positions with country codes as values and then doing a range-search type query for a given user specified (lat,lon).

What do you think?


Graham]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1595.page#6681</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1595.page#6681</link>
				<pubDate><![CDATA[Wed, 18 Nov 2009 14:17:21]]> GMT</pubDate>
				<author><![CDATA[ gmseed]]></author>
			</item>
	</channel>
</rss>