I created the yellow area as a shapefile by hand. Then I calculated the perimeter. I also created another shapefile (blue) manually and calculated the length, see image 1.
The next step was to subtract the perimeter of the yellow area with the length of the blue line and add the remaining green length (total green length - blue line) to calculate the length of the purple line, which was created manually, see image 2.
Does anyone know if there is another way to calculate the purple length? I tried using Vector > Intersection
to automatically generate the yellow area. Unfortunately, this did not work (the layer was empty). After that, I used Vector > Union
. But I have no access to the yellow area, see image 3.
I am at a loss at the moment.
I discarded the approach with Union and Intersection and instead applied split the line for both shapefiles. Then examined the attribute tables and created a query using a Virtual Layer.
SplitContourLine
returns five values where only one is relevant (row 1), see image 4.
I solved the problem by taking out all 0 and greater 5000 values, see image 5.
Now I want to access this inner line without using this condition c.ContourLen < 5000
to be more flexible when using this method for other examples.