ait-energy / qgis-edge-bundling

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

Bundling fails on datasets including zero length lines #3

Open paulds8 opened 6 years ago

paulds8 commented 6 years ago

Hi Anita

I keep getting the following error, regardless if I run the bundle edges script in Windows or Linux. Do you have any idea how to remedy it? I have some really great use cases for this bundling script, but I don't understand how to correct this issue.

2017-10-20T16:03:36 1   Cannot find variable: staticmethod
2017-10-20T16:03:37 2   Uncaught error while executing algorithm
            Traceback (most recent call last):
              File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute
                self.processAlgorithm(progress)
              File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\script\ScriptAlgorithm.py", line 378, in processAlgorithm
                exec((script), ns)
              File "<string>", line 313, in <module>
              File "<string>", line 164, in force_directed_eb
              File "<string>", line 103, in compute_compatibilty_matrix
            Exception: unknown
anitagraser commented 6 years ago

I cannot reproduce the issue. It sounds like an issue of correctly adding the scripts to Processing. Please list, in detail, which QGIS versions you are running and exactly which steps you're using.

paulds8 commented 6 years ago

At the moment I am running 2.18.12

In Windows I placed the scripts in: C:\Users\user.qgis2\processing\scripts

And in Ubuntu, I placed them in /home/user/.qgis2/processing/scripts

In both cases I was able to run the clustering scripts and I have created my own scripts that I have placed in these locations in the past.

It almost seems like the rest of the script can't access MiscUtils in my case. Unless I am just interpreting this incorrectly.

I have attached a sample of the data. Hopefully that might help: qgis_bundling_testdata.zip

anitagraser commented 6 years ago

I can reproduce the issue with this dataset. The issue is caused by zero length lines. If those are removed, it works.

I'll look into providing a better error message or ignoring those features ...

paulds8 commented 6 years ago

Thanks for getting to the bottom of that!

This data represents inter-connectivity between phone calls at a cell site level, so there are many cases where a person phones another person who receives the call through the same cell site.

I will have to find a way of visualizing those cases using an alternative method.

brylie commented 6 years ago

I am experiencing this issue as well. How do you recommend we filter out zero-length lines?

spatialsparks commented 6 years ago

Maybe filter out zero-length lines in bundling algorithm but make a new SHP-file including points of zero length lines (as zero length lines are basically just points)? This way no data gets lost but unused data (zero length lines) are still visualisable in the map?