How to group nearby latitude and longitude locations stored in SQL

前端 未结 2 1866
遥遥无期
遥遥无期 2020-12-24 09:41

Im trying to analyse data from cycle accidents in the UK to find statistical black spots. Here is the example of the data from another website. http://www.cycleinjury.co.uk

2条回答
  •  悲&欢浪女
    2020-12-24 10:06

    First, your example is quite misleading. You have two different sets of data, and you don't control the data. If it appears in a chain, then you will get a chain out.

    This problem is not exactly suitable for a database. You'll have to write code or find a package that implements this algorithm on your platform.

    There are many different clustering algorithms. One, k-means, is an iterative algorithm where you look for a fixed number of clusters. k-means requires a few complete scans of the data, and voila, you have your clusters. Indexes are not particularly helpful.

    Another, which is usually appropriate on slightly smaller data sets, is hierarchical clustering -- you put the two closest things together, and then build the clusters. An index might be helpful here.

    I recommend though that you peruse a site such as kdnuggets in order to see what software -- free and otherwise -- is available.

提交回复
热议问题