GeoNames Home
|
Postal Codes
|
Download / Webservice
|
About
GeoNames Forum
Search
Recent Topics
Back to home page
Register
/
Login
Finding nearby geonameid's
Forum Index
->
General
Author
Message
24/08/2009 16:11:52
Subject:
Finding nearby geonameid's
johnnytoobad
Joined: 24/08/2009 15:39:52
Messages: 1
Offline
So I have GeonameId and Lat & Long for any given position. I want to be able to find out nearby products to this position, my products tabel looks like:
ProductId ProductName GeonameId
-----------------------------------------------
1 Product 1 875124
2 Product 2 987412
etc
So my question is whats the best way to find which products are close by a given location? I am using the dump on a locale MySQL database.
26/08/2009 08:15:44
Subject:
Re:Finding nearby geonameid's
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
There are several approaches and which is best for your depends on your requirements, skills and environment.
You could add the lat/lng to the product table, that you don't have to join with all geonames records.
For the distance query you could use a spatial extension:
http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html
(geonames is using postgres with postgis)
or you could use a bounding box restriction on the coordinates and sort by your own distance implementation:
http://forum.geonames.org/gforum/posts/list/1081.page
Other threads:
http://forum.geonames.org/gforum/posts/list/692.page
http://forum.geonames.org/gforum/posts/list/727.page
Best
Marc
Forum Index
->
General
Go to:
Select a forum
Forum in English
-------------
General
Administrative Divisions
FAQ - frequently asked questions
Postal Codes
Discussion of GeoNames Toponyms
Forum in other language
-------------
Forum in Deutsch
Powered by
JForum 2.1.5
©
JForum Team
info@geonames.org
GeoNames Home
Postal Codes
Download / Webservice
Forum
About