I have a table in postgresql 9.2 that stores the latitude and longitude of locations as integer values.
I intend to do something like when a user searches for a location, he also gets information on other locations that are within a 7 mile radius of that searched location.
How do i use postGIS for this since i am new to it. Any idea.?
You’ll actually want to store the latitude and longitude as a point.
You can then get all points within a certain distance using STDWithin.
Or:
To boost performance a bit for other kinds of queries (not any seen here), use a GiST index: