Solved

Analyse difference in attribute value between neighbouring line segments

  • 20 June 2024
  • 7 replies
  • 77 views

Badge +1

Hello everybody

I am currently working with a watercourse network dataset (lines), which is divided into a new segment each time a new watercourse branch branches off or is integrated. Unfortunately, the dataset contains very obvious "errors" as the width of the watercourse between two consecutive segments is much too large and the orthophoto also clearly shows that there must be an error here.

I am not that experienced in FME yet and so far I have simply determined the points between the segments and was able to assign the different values of the touching watercourse arms to them. My main task is actually to provide the person responsible with an extensive data set that quickly shows where the difference between two watercourse widths is greater than XX metres (parameterisable). I have currently arrived at the status in the screenshot below, where the intermediate points with the water widths are listed for each line. Ideally, however, I would like to have only one line per point with the water widths inserted in new columns.Then I would have to find a procedure to be able to show points which have a greater difference in water widths than the XX metres.
Does anyone have any ideas as to how I can continue here or how I could proceed better in general?

Thank you in advance for your expertise
Best regards
Dani

 

 

 

icon

Best answer by lambertus 26 June 2024, 16:20

View original

7 replies

Userlevel 2
Badge +11

Hi @dantheman_5 interesting question, do you have some sample data of your water courses? Then I can create a script to find the water courses where the width of adjacent watercourses has a too big difference. 

Badge +1

Thank you for your answer :-).
 

I have uploaded a small test data set (shapefile or gdb) in the attachment. If there is anything wrong with it, please let me know.
If you are successful with a script, I would of course be very interested in it.

 

Thanks and best regards
Dani

Userlevel 2
Badge +11

@dantheman_5 thanks! I downloaded your data and will start with the analysis

Userlevel 2
Badge +11

Hi @dantheman_5 I made a workspace which is a solution I think to your question :)
For each water body it checks the direct neighbours and computes the difference in water width.

Snapshot of the output, for the 1st water body is this:


In this case water body with id 1, has 4 neighbours. these neighbours are shown in column Water_ID_of_neighbours. For each neighbour a row is made, I can combine these rows into one for each unique water body if you want. 

For each neighbour I computed the width compared to the original water body. Is this what you are looking for? Than I will upload the script as well.

Badge +1

Hi, 

 

Yes thx, this is pretty much exaktly what I was looking for :-).

I’m very intersted how you achieved it and will try to learn some things from your procedure.

 

Greetings
Dani

Userlevel 2
Badge +11

Hi @dantheman_5, sounds good :)

Find attached the workbench I created. You need to set the input data yourself. I used the file gdb you provided with 171 lines.

Be aware that 2 lines dont have a neighbour, the are added into the Sorter directly.

I hope this will work for you 😀 I am glad to hear your feedback about the script.
 

 

Badge +1

Hi @lambertus

 

I tested your script and it worked just fine for me, thx again :-).

I have added a small triage at the end to indicate the difference between the water widths of the two data sets at which a check / adjustment is required.

 I think I need to familiarise myself with the list option a little more, apparently so many tasks can be solved in a good way.

 

Greetings
Dani

Reply