Answer the question
In order to leave comments, you need to log in
Help, please, maybe there is a ready-made solution - search for the nearest points on the map
Good afternoon!
There is a table with coordinates (lat,lon) of points.
The user enters an address.
It is necessary to extract from the database those points that are at a distance specified in meters from the point that corresponds to the address.
I understand how to determine a point by address, but I didn’t work closely with the coordinates on the map. Maybe someone already faced this issue and have a solution at hand?
Answer the question
In order to leave comments, you need to log in
Have you heard of the diagonals of a square? Everything is done within 10 minutes. A more interesting task is when you need to find the nearest place from a point, despite the fact that the maximum search length is not specified and the place can be a couple of thousand kilometers away. And so then)
this is a good starting point %B5%D1%80%D0%BA%D0%B0%D1%82%D0%BE%D1%80%D0%B0
Calculating the distance and initial bearing between two points on a sphere .
tvsh2004.narod.ru/geo_koor.htm
At first I wanted to type the formulas for you, and then I found a good link with pictures. But as I understand it, you need to be accurate to meters, then the standard formula (in which the Earth is considered a sphere) may not be accurate in accuracy.
Кратчайшее расстояние между двумя точками на земной поверхности (если принять ее за сферу) определяется зависимостью: cos(d) = sin(φА)·sin(φB) + cos(φА)·cos(φB)·cos(λА − λB),
где φА и φB — широты, λА, λB — долготы данных пунктов, d — расстояние между пунктами, измеряемое в радианах длиной дуги большого круга земного шара.
Расстояние между пунктами, измеряемое в километрах, определяется по формуле: L = d·R, где R = 6371 км — средний радиус земного шара.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question