Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge lines in direction error #9

Open
AlisterH opened this issue Aug 17, 2023 · 4 comments
Open

Merge lines in direction error #9

AlisterH opened this issue Aug 17, 2023 · 4 comments

Comments

@AlisterH
Copy link

Merge lines in direction produces this rather incomprehensible error if there is a line that starts and ends at the same point:

Calculating feature informations...
Merging lines...
Saving output...
Traceback (most recent call last):
File "C:\Users/alister/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\lftools\processing_provider\Vect_DirectionalMerge.py", line 334, in processAlgorithm
fet.setGeometry(QgsGeometry.fromPolylineXY(item[0]))
TypeError: index 0 has type 'float' but 'QgsPointXY' is expected

Execution failed after 0.01 seconds
@AlisterH
Copy link
Author

"Lines to Polygon" also produces an error if there is a line that starts and ends at the same point.
I note that the "native" (built in) QGIS "lines to polygons" algorithm doesn't error in this case.

@LEOXINGU
Copy link
Owner

I fixed "Lines to Polygon" tool, but I didn't find the problem with "Merge lines in direction". Could you send some example as shapefile or geopackage?

@AlisterH
Copy link
Author

AlisterH commented Apr 30, 2024

Ah, yes, it seems it doesn't error with every "line that starts and ends at the same point". But here is an example.
example9.zip

@AlisterH
Copy link
Author

AlisterH commented Apr 30, 2024

I note also that it generally doesn't join lines which would form (or already are) a feature with two vertexes at the same point (except if it is the start and end points). Here is a file to demonstrate.
example2.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants