I
I
Ilya Magdenko2016-01-07 19:49:27
Database
Ilya Magdenko, 2016-01-07 19:49:27

How to create a site search using geolocation, where the user uses the search radius?

For example, I will use a site with ads .gumtree.com . Here, in the search parameters, you can specify the distance around the place to search. For example city or index + search radius. I would be very grateful if you have already seen such work. At the moment I can not find it and I have little idea how to implement it. If you know, drop the links. I will be extremely grateful! Thanks a lot!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Walt Disney, 2016-01-08
@duntik

On small radii, Euclidean geometry can be used.
On large ones, through the formula described for example here ru.scribd.com/doc/2569355/Geo-Distance-Search-with...
So that everything does not slow down, use geoindexes in the database, they are specially invented for this.
Well, you need to understand that searching in a circle from the coordinates of the city does not always make sense, for example, Volgograd is 60 km long, and a maximum of 5 km wide.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question