Skip to main content
Solved

LineOnAreaOverlayer - Road polygon attributes to centrelines

  • September 15, 2017
  • 5 replies
  • 113 views

barrett_h
Contributor
Forum|alt.badge.img+1

Hi all,

I have a polygon layer representing the sealed area of our road network with numerous attributes about the road. I also have a road centreline layer which has no attribute information. I want to get the road polygon attributes applied the appropriate centreline. The obvious transformer is the LineOnAreaOverlayer, however, this creates a lot of 'stub' centrelines that get associated with an intersecting road (please see image for an example).

In the example, a small section of Road 2 is given the attributes of Road 1.

So far the methodology that I have come up with is to:

1. assign a unique identifier to each centreline

2. process through the LineOnAreaOverlayer

3. determine the lengths of each segment

4. combine segments based on unique identifier

5. use the attributes of segment with the greatest length for the attributes of the centreline

Its not ideal as there is potential for error, so I would be keen to see if anyone else could come up with a better methodology.

Thanks as always!

Best answer by takashi

Hi @barrett_h, if you are sure that the middle point of a centerline is always within the correct road polygon, this workflow could also be possible.

  1. GeometryExtractor (Geometry Encoding: FME Binary): Store the geometry of center line as an attribute.
  2. Snipper (Snipping Mode: Distance (Percentage), Starting Location: 50, Ending Location: 50): Transform the center line into its middle point.
  3. Clipper (apply Merge Attributes option): Clip the middle points by the road polygons to merge attributes of road to inside point. SpatialFilter or PointOnAreaOverlayer can also be used instead.
  4. GeometryReplacer (Geometry Encoding: FME Binary): Restore the line geometry from the attribute storing the original geometry.
View original
Did this help you find an answer to your question?

5 replies

takashi
Influencer
  • Best Answer
  • September 15, 2017

Hi @barrett_h, if you are sure that the middle point of a centerline is always within the correct road polygon, this workflow could also be possible.

  1. GeometryExtractor (Geometry Encoding: FME Binary): Store the geometry of center line as an attribute.
  2. Snipper (Snipping Mode: Distance (Percentage), Starting Location: 50, Ending Location: 50): Transform the center line into its middle point.
  3. Clipper (apply Merge Attributes option): Clip the middle points by the road polygons to merge attributes of road to inside point. SpatialFilter or PointOnAreaOverlayer can also be used instead.
  4. GeometryReplacer (Geometry Encoding: FME Binary): Restore the line geometry from the attribute storing the original geometry.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • September 15, 2017

LineOnAreaOverlayer can be used too.

As the stubs get associated with at least 2 centerlines ( its origin line and the lines it touches). We'll assume that the centerline network is topology-wise correct.

You can use the list, remove duplicate elements and then remove the ones that have a listelement_count >1.


barrett_h
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 18, 2017
takashi wrote:

Hi @barrett_h, if you are sure that the middle point of a centerline is always within the correct road polygon, this workflow could also be possible.

  1. GeometryExtractor (Geometry Encoding: FME Binary): Store the geometry of center line as an attribute.
  2. Snipper (Snipping Mode: Distance (Percentage), Starting Location: 50, Ending Location: 50): Transform the center line into its middle point.
  3. Clipper (apply Merge Attributes option): Clip the middle points by the road polygons to merge attributes of road to inside point. SpatialFilter or PointOnAreaOverlayer can also be used instead.
  4. GeometryReplacer (Geometry Encoding: FME Binary): Restore the line geometry from the attribute storing the original geometry.
Thanks for the ideas @takashi. I really like that method for extracting the centre point of the line and this would have been the perfect solution apart from one limitation that I failed to mention. The road polygons are also segmented (ie. one road will have many segments, usually based on the type of seal on the road). Therefore, I also need to cut the road centrelines into the corresponding segments (you can see an example of a segment boundary just above the intersection on Road 1 in the original image). This means that the centre point only exists in one segment of the road and not the others... So far I have gone with my original method and haven't yet found any errors but I think it has the potential to create errors so I would like to improve it if possible.

takashi
Influencer
  • September 18, 2017
takashi wrote:

Hi @barrett_h, if you are sure that the middle point of a centerline is always within the correct road polygon, this workflow could also be possible.

  1. GeometryExtractor (Geometry Encoding: FME Binary): Store the geometry of center line as an attribute.
  2. Snipper (Snipping Mode: Distance (Percentage), Starting Location: 50, Ending Location: 50): Transform the center line into its middle point.
  3. Clipper (apply Merge Attributes option): Clip the middle points by the road polygons to merge attributes of road to inside point. SpatialFilter or PointOnAreaOverlayer can also be used instead.
  4. GeometryReplacer (Geometry Encoding: FME Binary): Restore the line geometry from the attribute storing the original geometry.
If the road polygons are topologically clean (i.e. no gaps and no overlaps between adjacent polygons), this workflow could be a solution.

 

 

Step 1: Create network lines from the boundaries of the road polygons, and select only lines each of which separates two adjacent road polygons that belongs to the same road. Call them as "separator".

 

 

Step 2: Split the center lines by the intersections with the separator lines (Intersector). If a center line doesn't cross any separator, find a road polygon that contains the middle point of the center line (SpatialFilter_2).

 

 


barrett_h
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 19, 2017
takashi wrote:
If the road polygons are topologically clean (i.e. no gaps and no overlaps between adjacent polygons), this workflow could be a solution.

 

 

Step 1: Create network lines from the boundaries of the road polygons, and select only lines each of which separates two adjacent road polygons that belongs to the same road. Call them as "separator".

 

 

Step 2: Split the center lines by the intersections with the separator lines (Intersector). If a center line doesn't cross any separator, find a road polygon that contains the middle point of the center line (SpatialFilter_2).

 

 

Thank you for such a comprehensive reply @takashi! It took me a while to work out what you were doing but it makes sense now :). I have used the first part of your workspace but I've modified the second part and in the process it also highlighted a situation that I hadn't yet considered. When one of our roads joins a road that is managed by the state authority I did need the stubs to be left in place as the state road authority manages these portions of road at an intersection. The second portion of the workspace ended up like this:

 

 

Thanks again for your help.

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings