GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
No country after querying by lat/long?  XML
Forum Index -> General
Author Message
oscar.almgren



Joined: 27/01/2011 03:18:13
Messages: 1
Offline

Hello
Using this line gives me 0 results.
Code:
SELECT g.`country` FROM geoname g WHERE g.`latitude` LIKE 29.313757 AND g.`longitude` LIKE 48.016216
Edit: I might have had the syntax wrong. Tried this but no better:
Code:
SELECT g.`country` FROM geoname g WHERE g.`latitude` = 29.313757 AND g.`longitude` = 48.016216
Using the same coordinates as input in Google Maps gives me that this is Kuwait.
I'm using MySQL and GeoNames have worked like a charm for other queries. The same happens with other coordinates. Am I doing something wrong as I was able to get out country BZ from another pair of coordinates?
Small description: I've imported GeoNames as per guide in another post on how to do that. I've successfully queried geonames for lat/long using location names (both from MySQL query browser as well as my Java app). Now given these lat/long I also want to look up what country those lat/long belong to since not all of my lat/long data was queried from GN but available from the beginning in my source data.
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

Oscar

The query will only return a result if the lat/long is identical, you will have to use some range query.

There are a couple of threads how to do this:
http://forum.geonames.org/gforum/posts/list/522.page
http://forum.geonames.org/gforum/posts/list/1500.page
and many others.

Best

Marc

PS: I have deleted a spam answer and blocked the forum user.

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team