C
C
Cord2011-07-15 14:51:48
OpenStreetMap
Cord, 2011-07-15 14:51:48

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

6 answer(s)
S
sergeyvolobuev, 2011-07-15
@sergeyvolobuev

pastebin.com/titXfx5n

S
sajgak, 2011-07-15
@sajgak

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)

J
joger, 2011-07-15
@joger

this is a good starting point %B5%D1%80%D0%BA%D0%B0%D1%82%D0%BE%D1%80%D0%B0

M
mduduzi_zungu, 2011-07-15
@mduduzi_zungu

Calculating the distance and initial bearing between two points on a sphere .

I
icc, 2011-07-15
@icc

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 км — средний радиус земного шара.

V
Vitaly Peretyatko, 2011-07-16
@viperet

www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question