java - coordinates based search -


i developing web page users can create activities , others find them via search function. when create activity must specify exact location take place, assisted google maps retrieve latitude , longitude. now, when doing search want have functionality find activities close specified location(also assisted google maps).

so have set of activities coordinates, coordinates of point want find activities nearby, , want return activities no more than, lets say, 5 km(or miles or whatever prefer) away point.

i having idea in head can solved calculating max/min latitude , longitude, , use these parameters in sql-query use clause filtering...the problem i'm facing here firstly calculating these max/min values, secondly in circular area(with radius 5km), , not rectangular

would appreciate input here! thanks!:)

coordinates not x , y latitude , longitude; need spherical distance unless points within rather small radius, e.g. few hundred miles.

if have many points, direct exhaustive search becomes slow, spherical or not. fortunately, gis extensions available both for mysql , for postgres. commercial dbs have spatial extensions. these make searches nearby objects efficient.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -