Skip to main content
Solved

Getting attribute information of multiple polygon intersected by line


hoa_le
Contributor
Forum|alt.badge.img+5

Hi everybody,

I have a map with 'Layer A' (polygons district boundary) and 'Layer B' (lines roads).

I would like to add a field on my 'Layer B' table with the name of every district crossed by each road.

In this example, I would like my Road 1 attribute to tell me it crosses 'City A', 'City B', 'City C', and 'City D'. And my road 2 attribute to tell me it crosses ‘City A’.

Could you please show me how to make it? Thank you

 

 

Best answer by liamfez

I would suggest the SpatialRelator and Generate List of the cities. Then use the ListConcatenator to create the attribute that has all the city names for each road.

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

7 replies

danilo_fme
Evangelist
Forum|alt.badge.img+41
  • Evangelist
  • June 17, 2024

Hello @hoa_le 

 

I suggest you to use te transformer LineOnAreaOverlayer and enable the List Attributes.


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • June 17, 2024
danilo_fme wrote:

Hello @hoa_le 

 

I suggest you to use te transformer LineOnAreaOverlayer and enable the List Attributes.

Hello @danilo_fme ,

If I use LineOnAreaOverlayer, it will split multiple road based on polygon? Actually, I want to keep number records in Road.


danilo_fme
Evangelist
Forum|alt.badge.img+41
  • Evangelist
  • June 17, 2024

Could you share your data?


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • Best Answer
  • June 18, 2024

I would suggest the SpatialRelator and Generate List of the cities. Then use the ListConcatenator to create the attribute that has all the city names for each road.


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • June 18, 2024
liamfez wrote:

I would suggest the SpatialRelator and Generate List of the cities. Then use the ListConcatenator to create the attribute that has all the city names for each road.

Thank you so much, I did it :)


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • June 19, 2024

Hi everyody,
If I want to calculate length intersect with each city or scale length of each road in the each city if the road cross. I dont’ want to use LineOnOverlayArea, because it seperate line.
How can I do? Thank you


lambertus
Enthusiast
Forum|alt.badge.img+12
  • Enthusiast
  • June 19, 2024

@hoa_le thats an interesting question. Although you dont want to use the LineOnArea Overlay tool, thats the tool you need in this case.

General Workflow
You need different transformers for this but the main steps are these ones:

  • Split the lines into sublines with LineonAreaOverlay
  • Compute the length of each subline
  • Join this information back to the original lines

You could include an attribute for example with the length distribution of the crossed cities in            your final dataset:
'Length per city':
1500 m - city A - 1000 m - city B - 2000 m - city C - 100m - city D

I can supply you with a workspace when needed :)


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