Skip to main content
Solved

How to detect polygon that majority of line falls within?

  • September 11, 2018
  • 2 replies
  • 104 views

nicholas
Contributor
Forum|alt.badge.img+10

Hello all,

I have two layers, one of roads (lines) and one of electorates (polygons). The roads intersect the electorates and one road can intersect more than one electorate.

For each road feature, I want to add the name of the electorate that the majority of the road falls within.

I am using a SpatialFilter to populate the roads with the names of electorates but I don't know how the transformer chooses which electorate to populate the road feature with. Is it just the first electorate that happens to intersect?

Best answer by virtualcitymatt

You could look at the LineOnAreaOverlarlayer. That will cut the roads so you can calculate their lengths. From there you can figure out which rods go with which polygon and merge the polygon name back on to the original road.

View original
Did this help you find an answer to your question?

2 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35
  • Celebrity
  • Best Answer
  • September 11, 2018

You could look at the LineOnAreaOverlarlayer. That will cut the roads so you can calculate their lengths. From there you can figure out which rods go with which polygon and merge the polygon name back on to the original road.


nicholas
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • September 13, 2018

I did use the LineOnAreaOverlayer, and then followed this with;

- Sorter by length (descending)

- DuplicateFilter keeping the longest only


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