How to group latitude/longitude points that are 'close' to each other?

前端 未结 5 626
星月不相逢
星月不相逢 2021-01-31 09:30

I have a database of user submitted latitude/longitude points and am trying to group \'close\' points together. \'Close\' is relative, but for now it seems to ~500 feet.

5条回答
  •  误落风尘
    2021-01-31 09:36

    If I were tackling it, I'd start with a grid. Put each point into a square on the grid. Look for grids that are densely populated. If the adjacent grids aren't populated, then you have a decent group.

    If you have adjacent densely populated grids, you can always drop a circle at the center of each grid and optimize for circle area vs (number of points in the circle * some tunable weight). Not perfect, but easy. Better groupings are much more complicated optimization problems.

提交回复
热议问题