Comments (35)
Another idea: could it be that lines can only be straight lines from A -> B and lines with a via (A -> B -> C) break the script?
from qgis-edge-bundling.
One thing that got me was the 'initial step size' being waaaay to large by default. It assumes a CRS in meters, whereas the data may be in a geographic CRS (EPSG 4326 above). Setting the initial step size to 0.0001
may be desirable in your dialogue.
from qgis-edge-bundling.
Another thought, does your data cross the prime meridian?
from qgis-edge-bundling.
Hi! Will try with a smaller stepsize ASAP. I have now backtracked the error up untill the line:
dot = edges_as_vect[i].normalized() * edges_as_vect[j].normalized()
in bundle_edged.py
And no: the data is only in Switzerland around 47°N/7°E +- 3°
from qgis-edge-bundling.
Ok, so Im still getting the error with 0.0001 stepsize:
Could it be a version missmatch of sklearn and scipy or something similar?
from qgis-edge-bundling.
Ah OK cool. I just went to a mobility as a service conference, called iCoMaaS, where the Swiss public transport system was held in high regard! :-)
from qgis-edge-bundling.
Would you mind, privately, sharing a sample of your data? I will try to reproduce locally.
from qgis-edge-bundling.
Have you tried reprojecting your data to a metric CRS? Also, is there any output in the Python error log? (Log can be opened by clicking on the speech bubble icon in the bottom right corner of the QGIS window.)
from qgis-edge-bundling.
@anitagraser from where does the edges_as_vect
list inherit the normalized()
method?
from qgis-edge-bundling.
Hehe! Indeed, the public transportation services are great! :)
I now also tryed reprojecting data to EPSG 2056 (swiss coordinate system, metric units) with the same results.
Here is the output from the error log:
2017-12-12T09:52:54 1 Cannot find variable: staticmethod
2017-12-12T09:52:54 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 328, in <module>
File "<string>", line 173, in force_directed_eb
File "<string>", line 106, in compute_compatibilty_matrix
Exception: unknown
I have set manual prints in the python file and it seems to be running through up untill the line mentioned.
from qgis-edge-bundling.
Ps. could you give me your mail so I can send you a sample of the data? (Or how does this work on github private sharing? Should I invite you to my private repo?)
Pps. Hi Anita, came across this plugin through your colloquium talk at the UZH a few weeks back, great talk btw! :)
from qgis-edge-bundling.
My work email is [email protected]
from qgis-edge-bundling.
Thx, already invited you both to a private repo 👍
from qgis-edge-bundling.
Another Ps: I also tryed a complete reinstall of QGIS and python and everything before posting here, this shouldnt be an issue
from qgis-edge-bundling.
I also tryed a complete reinstall of QGIS and python
That's epic troubleshooting :-)
from qgis-edge-bundling.
I got a bit further: Now it seems to be running (initialising 10%) and then crashing. What I did was:
Select all features in attribute table:
Then ran the v.clean tool in the GRASS GIS toolbox (didnt work without selecting all features):
The error now is: 'NoneType' object has no attribute 'distance' See log for more details
Error log:
2017-12-12T10:26:03 1 Exception: IllegalArgumentException: point array must contain 0 or >1 elements
2017-12-12T10:26:03 1 Exception: IllegalArgumentException: point array must contain 0 or >1 elements
So I guess the problem is in my data somewhere...
from qgis-edge-bundling.
Looks like it could be zero-length lines again: #3
from qgis-edge-bundling.
@anitagraser good point.
@JoranBeaufort could you try producing a derivative by filtering out zero length origin-destination lines? E.g.
Then, try re-running the edge bundling on the new layer.
from qgis-edge-bundling.
on it
from qgis-edge-bundling.
Cool beans. I added links for quick reference.
from qgis-edge-bundling.
So I just did this, for comprehension, here the steps:
Get line lengths (I saved them as ints, but float would be better):
Then using the select by expression with "length" = 0 selected all lengths = 0 (obviously) and deleted them. Then exported as a new SHP with EPSG:2056 (metric). Tryed the bundle tool and still get the error:
2017-12-12T10:41:32 1 Cannot find variable: staticmethod
2017-12-12T10:41:32 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 315, in <module>
File "<string>", line 164, in force_directed_eb
File "<string>", line 103, in compute_compatibilty_matrix
Exception: unknown
I might be missing something very obvious, but I cant seem to grasp what ATM...
from qgis-edge-bundling.
Length should be greater than zero.
from qgis-edge-bundling.
Zero length lines may underly the issue.
from qgis-edge-bundling.
Oops, I deleted the 0 length lines, sry, wrote it wrong above... Edited now.
from qgis-edge-bundling.
Did you try with my data? Does it work on your PC?
from qgis-edge-bundling.
Maybe issue #9 has something to do with it?
from qgis-edge-bundling.
Yes, that's possible.
from qgis-edge-bundling.
Ok, have now created trajectories of lines with single line segments and its been processing for the past 1.5 hours, ill update you with what happens :)
Edit:
Coming up on 2.5 hours now. QGIS has become unresponsive, seems to be processing still.
from qgis-edge-bundling.
Ok, soOk, so it finally worked by using lines which are not of length 0 and lines with only 2 nodes (origin - destination). I could not cluster them using the optimal clustering algorithm (see issue #9 ) but the "manual" clustering worked. But I could not use the clusters in the bundle_lines tool.
To summarise, what I needed was:
- Lines with length > 0
- Lines with only 2 nodes (origin destination)
- EPSG:4326
- Use the tool bundle_lines without using clusters
I will report if I find out more... 👍
from qgis-edge-bundling.
(Just as a note: Some examples in the paper were made with other CRS than EPSG:4326. The challenge is to chose the right parameters for a specific CRS and dataset.)
from qgis-edge-bundling.
Here are the results I get after simplifying all lines to direct OD connections: https://www.dropbox.com/sh/fkrf7b7xm9e9dgy/AABjJKHSUwkx4EDjS3EihTd8a?dl=0
from qgis-edge-bundling.
Ill have a look first thing tomorrow morning, thanks so much! 👍
from qgis-edge-bundling.
Looks good, thanks! So the main problem was that the data needs to be linelength > 0 AND lines only with 2 nodes: origin, destination. Added small description to the readme, feel free to merge. Ps. would feel obliged if you could remove the dropbox link to the data again :) Best regards!
from qgis-edge-bundling.
would feel obliged if you could remove the dropbox link to the data again
Done.
from qgis-edge-bundling.
Thanks alot! 👍
from qgis-edge-bundling.
Related Issues (20)
- Tips for 3.0 port HOT 7
- Use edge bundle data with kepler.gl HOT 2
- Bundling fails on Multilinestring HOT 5
- Porting clustering and summarize HOT 2
- Add option to ignore clustering in summarize tool
- UnboundLocalError: local variable 'visibility1' referenced before assignment HOT 2
- QGIS 3.6 and Python 3 importing issues HOT 2
- Installing from ZIP HOT 2
- Support Python 3? HOT 1
- ERROR: "range() integer end argument expected, got float." when running the edge bundling tool
- Edge bundling without qgis HOT 1
- Usage in QGIS 3 HOT 5
- ModuleNotFoundError: No module named 'processing.core.ProcessingLog' HOT 5
- Bundling fails on datasets including zero length lines HOT 6
- Configuring edge bundling parameters for regional UK data in WGS84 HOT 17
- Step-by-step tutorial? HOT 4
- Add documentation about script options HOT 1
- Time-series animation of edge bundles?
- Error in "cluster lines kmeans with ideal number of clusters" when not WGS84 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qgis-edge-bundling.