Question

Finding trees in an (road) alley


Badge

Dear FME community,

 

 

I have a question regarding trees along a road (alley trees).

 

 

In the following example, the green points represent trees at the roadside, i.e. left or right side of the road. The red points are felled trees and can be ignored.

 

 

We want the length of the road where there are trees in one row at only one side (example 1) and trees in an alley (examples 2 and 3). An alley is where there are trees on both sides of the road, but only if it is more than 50 metres long and if there are more than 8 trees per row.

 

Perhaps there is an attribute way: we also have the measures on the road in addition to the coordinates, for example:

Tree 1 at road segment XYZ has the station 50 and is located left. That means it is 50 metres away from the beginning of the road. Tree 2 at the same road segment XYZ with station 52 is located right side. If there are more than 50 metres of these "couples", then it is an alley which we want to identify. The total length is also stored in the table.

Road Segment

 

Station

 

Side (left/right)

 

Road length

 

XYZ

 

50

 

L

 

1000

 

XYZ

 

52

 

R

 

1000

 

XYZ

 

61

 

L

 

1000

 

XYZ

 

60

 

R

 

1000

 

XYZ

 

70

 

L

 

1000

 

XYZ

 

72

 

R

 

1000

 

XYZ

 

85

 

L

 

1000

 

XYZ

 

86

 

R

 

1000

 

XYZ

 

100

 

L

 

1000

 

XYZ

 

103

 

R

 

1000

 

 

In the example of the above table, the length of the alley for this road segment would be 53 metres.

 

I don't now if this one can be solved without python knowledge, but perhaps somebody can give me a hint how to start. Any help is appreciated!

 

Many thanks and kind regards

Thomas

 


6 replies

Userlevel 1
Badge +21

You could use a statistics calculator to get the range for each road segment

Badge

You could use a statistics calculator to get the range for each road segment

Thank you. That works for the example, but I think this will be a problem if there is a "gap". Say if the last point (tree) would be at station 200. Then the range of the alley will be too long. Also, do you know how I can test if the points lay on both sides of the road (not just on one)?
Userlevel 1
Badge +21
Thank you. That works for the example, but I think this will be a problem if there is a "gap". Say if the last point (tree) would be at station 200. Then the range of the alley will be too long. Also, do you know how I can test if the points lay on both sides of the road (not just on one)?

When does a gap between trees become a 'gap'?

 

Badge

When does a gap between trees become a 'gap'?

 

If the distance between the points is more than 30 metres long, then it would be a "gap".

I also have to test if a row has at least 8 points in it, otherwise it wouldn't be a row, just some single tree. And these eight trees have to be at the other side of the road in some form (with an allowed offset of course), so that is forms the alley.

 

Any ideas?

Userlevel 1
Badge +21

If the distance between the points is more than 30 metres long, then it would be a "gap".

I also have to test if a row has at least 8 points in it, otherwise it wouldn't be a row, just some single tree. And these eight trees have to be at the other side of the road in some form (with an allowed offset of course), so that is forms the alley.

 

Any ideas?

Assuming your trees already have the station and side attributes. How about

  • buffer each tree by 30m.
  • dissolver grouping by the road id and build a list.
  • A list range extractor on each dissolved feature will give you the min and max station which you can use to calculate the range
  • Test if range is greater than 50
  • List duplicate remover followed by a list element counter - if there are 2 elements there are trees on both sides

@thomask

an example

tree_alley.fmwt

Badge +3

@thomask

 

Turn the road into a network and neighbourfinder to get the insertionpoints onto the network.

You can also use meassures to get the gaps and test if both sides are sufficiently occupied.

You can use leftrightcalculator (or query the orientation of the connecting line to tree).

 

Got some same asmple data ?

 

 

Reply