I have profile data points which lie almost on a line (s. picture below)

Is there an easy way / plugin to add an attribute to each point which states to which profile line it belongs?

It should not be very difficult from a mathematical point of view in my opinion?

In other words: I want to create clusters from my points and each cluster should contain the points that belong to one profile line. So that in a second step I can fit a line through each of the profile points

my source data

  • What software / tools / languages are you able to use for this? Commented Dec 13, 2016 at 18:22
  • Do the points have any attributes? Are they ordered? Commented Dec 13, 2016 at 19:23
  • Hi, sorry, I forgot. I'm using Qgis 2.14.3 and the points don't have attributes other than a height information (these are crosssections of a riverbed). I don't know which tools I can use for my task - I was looking through the plugins related to cluster analysis but I did not find anthing useable for this particular question...
    – Mathiaas
    Commented Dec 14, 2016 at 6:12
  • I mean isn't it possible to take advantage of the fact that the point groups that belong to the same profile are very close to each other while the profile groups have much larger distances? For the eye its absolutely obvious how to seperate the clusters. (sorry if this sounds silly, Im'm not an expert in statistics or so, thats why I ask)
    – Mathiaas
    Commented Dec 14, 2016 at 6:17

2 Answers 2


Ok, for now I found a solution:

Clustering points/polygons based on proximity (within specifed distance) using QGIS?

Its not based on statistics, but does what its supposed to!


you can certainly do this with scikit-learn/python and pandas. This tutorial demonstrates how to cluster spatial data with scikit-learn's DBSCAN using the haversine metric, and discusses the benefits over k-means that you touched on in your question.

An example of clustering data points in given in this tutorial.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.