Open spatialsparks opened 6 years ago
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.
Another thought, does your data cross the prime meridian?
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°
Ok, so Im still getting the error with 0.0001 stepsize:
Could it be a version missmatch of sklearn and scipy or something similar?
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! :-)
Would you mind, privately, sharing a sample of your data? I will try to reproduce locally.
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.)
@anitagraser from where does the edges_as_vect
list inherit the normalized()
method?
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.
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! :)
My work email is brylie.oxley@maas.global
Thx, already invited you both to a private repo 👍
Another Ps: I also tryed a complete reinstall of QGIS and python and everything before posting here, this shouldnt be an issue
I also tryed a complete reinstall of QGIS and python
That's epic troubleshooting :-)
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...
Looks like it could be zero-length lines again: https://github.com/dts-ait/qgis-edge-bundling/issues/3
@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.
on it
Cool beans. I added links for quick reference.
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...
Length should be greater than zero.
Zero length lines may underly the issue.
Oops, I deleted the 0 length lines, sry, wrote it wrong above... Edited now.
Did you try with my data? Does it work on your PC?
Maybe issue #9 has something to do with it?
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?
Yes, that's possible.
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.
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:
I will report if I find out more... 👍
(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.)
Here are the results I get after simplifying all lines to direct OD connections: https://www.dropbox.com/sh/fkrf7b7xm9e9dgy/AABjJKHSUwkx4EDjS3EihTd8a?dl=0
Ill have a look first thing tomorrow morning, thanks so much! 👍
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!
would feel obliged if you could remove the dropbox link to the data again
Done.
Thanks alot! 👍
Hi Anita
I am trying to get the scripts to work, but currently without success. I have tried with and without clustering, but always get errors:
Example of the set options:
Error in Log:
Might you have an idea of how to get to the bottom of this?
QGIS version: 2.18 Python version: 2.7.5
CRS of data: EPSG 4326 number of lines: 301
Best regards