Geographic Information Systems Asked by user146310 on August 11, 2021
What seemed to be an easy task turned out to be not that easy.
I want to measure line length in separate polygons.
My steps so far:
And here strange things happen: The lines, cutted with the lines from the polygon, still dont get correctly selected at the boarders. I get one half, but not both of the cutted lines.
Like, one part of the splitted line isnt within the polygon. But i cutted them with the boarders of the polygon and didnt move them.
If I understand your question correctly, you want to achieve something like this:
where the black dashed line is the original line layer and you want the length of the red lines. (dont mind my label, my length here is actually in degree, I just labeled it as meters)
You can use this query:
Select
ST_Length(ST_Intersection(l.geometry,p.geometry)) as line_length,
ST_Intersection(l.geometry,p.geometry)
from lines as l, polygons as p
where ST_Length(ST_Intersection(l.geometry,p.geometry)) is not null
PS: virtual layers do work on temporary layers.
Answered by MrXsquared on August 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP