N
N
nikivanz2019-04-23 16:15:52
MySQL
nikivanz, 2019-04-23 16:15:52

What is the best system for finding the nearest points?

Hello. The crux of the matter is as follows. I find it difficult to choose the approach by which I will do the search for the nearest points near the point.
A little about the task:
1. There is a table with stores in the database
2. A point is given
3. It is necessary to find the nearest stores to the point.
It is advised to dig towards Google MAPS. Okay, but is it possible to do something like that there? What if there are many shops?
I am thinking about using MySQL and PHP tools, there is a Spatial index for points in the database, I have never used it, but I think to dig in this direction.
Who had experience in similar tasks? What approach can you recommend?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2019-04-23
@Rsa97

Spatial will only give you geometric proximity. But what if the nearest store in a straight line is 300 meters across the river, and a couple of kilometers to the bridge? According to the mind, you need to build routes through Google Maps or Yandex Maps and compare the length of the routes. Again, for a pedestrian and a motorist, the routes will be different.

F
freeExec, 2019-04-23
@freeExec

You think correctly, Google MAPS here should act as a display, no more, but a search on the server. Otherwise, you will have to give the client all the points first, so that later he can search for himself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question