How can I search for geo objects by a certain perimeter? For instance. I have several objects with Lat / Lon coordinates stored in my database. Now I want to get all the objects that lie in a certain perimeter (10 miles or 20 miles) around a certain point.
I assume that I will need to make the following query:
SELECT * FROM objects o where o.lat < (myPositionLat+x) AND o.lon < (myPositionLon+y)
Is it correct? How to determine / set values for x and y?
source
share