ait-energy / qgis-edge-bundling

GNU General Public License v2.0
63 stars 14 forks source link

Porting clustering and summarize #15

Open lucasvw opened 5 years ago

lucasvw commented 5 years ago

Hi Anita,

First of all, congrats on all your super interesting work in the field of OS GIS software, really impressive!

I have been trying out the edge-bundeling for QGIS 3.0 and already have some very interesting results. I saw from your blog and in the repo that for QGIS2 you also have two additional tools, the clustering pre-processing and the summarize. Are you planning or anybody else on porting those as well to QGIS3.0?

I also tried to use the standard k-means clustering in QGIS3.0 prior to the edge-bundeling which seemed to work as well. What is the difference between the standard and your custom k-means clustering?

Best, Lucas

anitagraser commented 5 years ago

Hi Lucas,

Thank you for the kind words!

The documentation of the built-in K-Means clustering tool in QGIS 3.4 states

If input geometries are lines or polygons, the clustering is based on the centroid of the feature.

The clustering we implemented in https://github.com/dts-ait/qgis-edge-bundling/blob/master/cluster_lines_kmeans.py uses start and end points instead and lines are clustered irrespective of direction.

I'm not aware of any current plans to port the old script but if you're interested in looking into it, that would be a very welcome contribution!

lucasvw commented 5 years ago

Hi Anita,

Thank you for your quick reply.

Ah yes, I see.. clustering on centroid seems to be quite suboptimal for my use-case. Perhaps I can do k-means clustering twice manually on (1) start-points and (2) end-points, and build new clusters from the permutations. That way the clusters would even take direction into consideration 🤔

I have to see if I can find the time to spend on porting, but I must say I am not familiar with the PyQGIS API.

Thanks again!