Optimizing search through large list of lat/long coords to find match

后端 未结 2 1635
-上瘾入骨i
-上瘾入骨i 2020-12-11 13:46

I need to create a page that

  1. takes 2 addresses (to and from),
  2. plots the route AND areas within 1 mile of this route,
  3. THEN figure out i
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 14:44

    You can use a spatial index and search for a 2d range,i.e. bounding box. For example with the MySQL spatial extension. You can also try my hilbert curve class (phpclasses.org) it uses a quadkey with a range search and it's a pure php solution. You can also try a quadtree it has some better perfomance over a r-tree.

提交回复
热议问题