Subscribe to this thread
Home - General / All posts - M9 Splitting lines into contiguous sections
danb


1,958 post(s)
#20-Sep-22 00:48

I have filtered out a set of watercourses possessing the desired characteristics to be included in a stream bank survey that we undertake. My aim is to then break these watercourses into 500m bank length samples to provide a regional database of all potential samples. When the field staff go out in the summer, they will walk approximately 400 of these 500m samples collecting points where one of the recorded characteristics changes on either bank. This data is then converted into continuous bank length samples back in the office and the data analysed by a statistician for the purpose of regional reporting and trend analysis.

Anyway, I have all of the characteristics in my base layer, I then merge these watercourses into a new drawing using the transform pane (see Clipboard 1). Next I split these into 500m sections again using the transform pane to get to what I hope with a bit of tidying will be the final potential samples database.

My problem is that when I split the linework into 500m sections, although I get 500m stream parts, these are typically consist of bits of multiple disconnected branches as shown in Clipboard 2.

Can anyone suggest a way to avoid this, only returning only contiguous sections? Previously I have done it in M8 where I believe I used the network tools (part of the Business Tools add in) to do something like a shortest route between points spaced at 500m along the suitable sections. I would however like to move this now to M9 so any pointers would be much appreciated.

Attachments:
Clipboard-1.png
Clipboard-2.png


Landsystems Ltd ... Know your land | www.landsystems.co.nz

danb


1,958 post(s)
#20-Sep-22 01:44

Just fiddling around in M8. Even the equivalent of JoinLines would be pretty handy.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

adamw


10,175 post(s)
#20-Sep-22 13:49

The 500m line in Clipboard-2 is disjoint, I can see that. But does this happen because the original line (that this 500m line was part of) was also disjoint? If yes, the original line was disjoint as well, it would probably make more sense to make the original lines "less disjoint" (join them where possible). If no, the original line was contiguous, cutting a contiguous line into parts should have produced contiguous parts, so we'd like to have a look at the data to better understand what happened (just a single original line with no fields would be fine as long as it can be used to reproduce the issue).

danb


1,958 post(s)
#21-Sep-22 03:16

Thanks for your interest Adam. I can throw away the attributes in the source later (as I do with the merge) but I am not sure internally how GeomMergeLines merges the linework. Project sample data and queries attached.

Attachments:
M9 FORUM SPLIT.mxb


Landsystems Ltd ... Know your land | www.landsystems.co.nz

adamw


10,175 post(s)
#21-Sep-22 13:28

I get it now. You have tons of small lines. You first join them into one big line using GeomMergeLines, then you split that line into 500m parts. It seems you don't want to split small lines into 500m parts directly because you want these parts to continue from one small line to another, if some of the small lines touch.

Fine. The thing is, GeomMergeLines does not join individual branches together, it just collects all branches of all lines. The lines go in essentially random order. So, when you split the result into 500m parts, whenever one of the parts reaches the end of one of the small branches mid-way, it then continues on another branch. That second branch is essentially random, so given that the total number of lines is big, it is nearly always far from where the previous branch ended. That's why many of the parts you are getting are disjoint.

Try joining small branches in the big line returned by GeomMergeLines by normalizing its metric. This can be done using a transform, or using a call to GeomNormalize. Then repeat the split.

I did that and the total number of branches in all 500m parts reduced from 7072 without normalization to 5130 with normalization. If you don't want any parts to be disjoint, ie, you want to keep individual lines as long as possible (continue each line until it runs into a 3+-way intersection) and then split each such line into 500m parts, decompose the normalized big line into individual branches before performing the split.

danb


1,958 post(s)
#21-Sep-22 19:57

Great many thanks for this clear explanation. I will definitely give GeomNormalize a go and am anxious not to have to go back doing it in M8.

If you don't want any parts to be disjoint, ie, you want to keep individual lines as long as possible (continue each line until it runs into a 3+-way intersection) and then split each such line into 500m parts, decompose the normalized big line into individual branches before performing the split.

I am intrigued by your comment here. Is there a method to achieve continuing to a 3 way intersection in M9? Or is this achieved by GeomNormalize? This was essentially what I was achieving in M8 using Join Lines which is sufficient for this purpose, though I think when I did it originally using the routing tools in M8, they would traverse junctions without issue.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

tjhb

9,993 post(s)
#22-Sep-22 06:34

Dan,

I have had trouble following—I tried to see but could not at least until adamw’s intervention—but I think the concept you need is just line branches, after normalization of the line set.

So: merge lines by pertinent attributes, then normalize the result (I think for your purpose by topology, but perhaps only by metrics, especially if you want to see class-on-class overlaps and other potential errors), then split the normalized branches into separate lines.

The normalization step involves deriving a network graph, which I think is what you want.

(But maybe I still have misunderstood.)

adamw


10,175 post(s)
#22-Sep-22 10:05

Is there a method to achieve continuing to a 3 way intersection in M9? Or is this achieved by GeomNormalize? This was essentially what I was achieving in M8 using Join Lines which is sufficient for this purpose

Yes, GeomNormalize on a line should both split branches at intersections and continue small branches to grow as big as possible (continue until either there's nowhere else to go, or there's more than one way to go = a 3+-way intersection).

danb


1,958 post(s)
#22-Sep-22 20:59

Thanks gents, much appreciated. GeomNormalize will be sufficient here I think.

Tim, I initially have required attributes (pre-merge) as I need to ensure that the sections possess all the required characteristics. I can then however throw these away temporarily to do the merge and split before re-adding them further down the track when I need to randomly select groups of samples with particular characteristics. Typically I the statistician needs a certain population of samples by management zone, Strahler and broad pastoral land use i.e. dairy and dry stock.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.