Git Product home page Git Product logo

Comments (35)

spatialsparks avatar spatialsparks commented on August 20, 2024 1

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.

brylie avatar brylie commented on August 20, 2024

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.

brylie avatar brylie commented on August 20, 2024

Another thought, does your data cross the prime meridian?

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

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.

spatialsparks avatar spatialsparks commented on August 20, 2024

Ok, so Im still getting the error with 0.0001 stepsize:
screenshot 2017-12-12 09 42 14

Could it be a version missmatch of sklearn and scipy or something similar?

from qgis-edge-bundling.

brylie avatar brylie commented on August 20, 2024

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.

brylie avatar brylie commented on August 20, 2024

Would you mind, privately, sharing a sample of your data? I will try to reproduce locally.

from qgis-edge-bundling.

anitagraser avatar anitagraser commented on August 20, 2024

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.

brylie avatar brylie commented on August 20, 2024

@anitagraser from where does the edges_as_vect list inherit the normalized() method?

https://github.com/dts-ait/qgis-edge-bundling/blob/6af5d4e0f5536e2302b807f36d8e38e4f48de560/bundle_edges.py#L83-L102

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

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.

spatialsparks avatar spatialsparks commented on August 20, 2024

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.

brylie avatar brylie commented on August 20, 2024

My work email is [email protected]

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

Thx, already invited you both to a private repo 👍

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

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.

brylie avatar brylie commented on August 20, 2024

I also tryed a complete reinstall of QGIS and python

That's epic troubleshooting :-)

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

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:
screenshot 2017-12-12 10 23 08

Then ran the v.clean tool in the GRASS GIS toolbox (didnt work without selecting all features):
screenshot 2017-12-12 10 23 53

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.

anitagraser avatar anitagraser commented on August 20, 2024

Looks like it could be zero-length lines again: #3

from qgis-edge-bundling.

brylie avatar brylie commented on August 20, 2024

@anitagraser good point.

@JoranBeaufort could you try producing a derivative by filtering out zero length origin-destination lines? E.g.

  1. calculate the line lengths
  2. select all lines with length > 0
  3. export as shape file (and re-import)

Then, try re-running the edge bundling on the new layer.

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

on it

from qgis-edge-bundling.

brylie avatar brylie commented on August 20, 2024

Cool beans. I added links for quick reference.

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

So I just did this, for comprehension, here the steps:
Get line lengths (I saved them as ints, but float would be better):
screenshot 2017-12-12 10 37 21

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.

brylie avatar brylie commented on August 20, 2024

Length should be greater than zero.

from qgis-edge-bundling.

brylie avatar brylie commented on August 20, 2024

Zero length lines may underly the issue.

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

Oops, I deleted the 0 length lines, sry, wrote it wrong above... Edited now.

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

Did you try with my data? Does it work on your PC?

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

Maybe issue #9 has something to do with it?

from qgis-edge-bundling.

anitagraser avatar anitagraser commented on August 20, 2024

Yes, that's possible.

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

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.

spatialsparks avatar spatialsparks commented on August 20, 2024

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.

anitagraser avatar anitagraser commented on August 20, 2024

(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.

anitagraser avatar anitagraser commented on August 20, 2024

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.

spatialsparks avatar spatialsparks commented on August 20, 2024

Ill have a look first thing tomorrow morning, thanks so much! 👍

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

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.

anitagraser avatar anitagraser commented on August 20, 2024

would feel obliged if you could remove the dropbox link to the data again

Done.

from qgis-edge-bundling.

spatialsparks avatar spatialsparks commented on August 20, 2024

Thanks alot! 👍

from qgis-edge-bundling.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.