M
M
magary42015-04-20 10:17:03
PHP
magary4, 2015-04-20 10:17:03

Sort geodata by distance. mysql, php or js?

about 10 thousand markers are displayed on the map. under the map, a list of the nearest should be displayed.
tried adding at fetch level mysql SELECT glength(LineString(GeomFromText(astext(PointFromWKB(POINT(63.424818,10.402457)))),GeomFromText(astext(PointFromWKB(POINT(663.422238,10.398996)))))))*100 stackoverflow .com/questions/11436396/mysql-spatial... but it takes a long time.
what can you advise?
nothing else comes to mind except after receiving the data, run this distance calculation at the js level and display this list after the calculations are over, i.e. after 20-30 seconds the
markers are grouped into a cluster. maybe you can somehow get the distance to the first marker in the cluster?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2015-04-20
@DmitriyEntelis

Looking for nearby objects on the map?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question