GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Using allCountries Data Dump  XML
Forum Index -> General
Author Message
smith7800



Joined: 01/09/2008 01:57:56
Messages: 3
Offline

Yesterday I downloaded the allCountries dump and inserted it into a mysql db. However, when I query it using lat and lng points that are successful with the geonames web service, my local query returns nothing.
For instance, this query:
Code:
  SELECT *
 FROM `geonames`
 WHERE `latitude` = 43.0946
 AND `longitude` = - 79.0261
 LIMIT 0 , 30 
 

returned no results.
Thinking that the web service must perform some sort of truncate operation on its input, so I tried this:
Code:
  SELECT *
 FROM `geonames`
 WHERE `latitude` LIKE '43'
 AND `longitude` LIKE '-79'
 LIMIT 0 , 30 
 

Still no results. When I feed that point to the web service, It returns Niagara Falls, NY, USA.

Can somebody help me understand what I am doing wrong?

marc



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

For nearby queries you should use the spatial functions and operators of your database system.

This thread has more information about mysql:
http://forum.geonames.org/gforum/posts/list/692.page

Marc

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