Skip to main content
Solved

How to merge group of lines based on spatial touch

  • November 29, 2018
  • 4 replies
  • 325 views

lazarlubomir
Contributor
Forum|alt.badge.img+7

Hello,

please, I have question about line merging. I have got data of furniture in buidling, but e.g. chest of drawers in 2D is chopped into 29 lines (check my pic below). What I need - merge all lines into one line feature. Unfortunately, there is no attribute what can define ID or unit of chest of drawers, so the geometry aggregation must be based on spatial touch. In drawing, there are lot of chests of drawers, not just one.

Any tips please?

Thank You so much!

Lubo

Best answer by ebygomm

Send your lines into a spatial relator as both requestor and supplier to find relationships of lines that touch. Generate a list containing the unique id of each line with a relationship. Then use a listcombiner (custom transformer) with the source list as the list just generated and the unique id of each line as an additional source and this will create common groupings which you can then use to aggregate your features with.

 

Example with dummy data

Aggregate_by_touch.fmwt

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

4 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • Best Answer
  • November 29, 2018

Send your lines into a spatial relator as both requestor and supplier to find relationships of lines that touch. Generate a list containing the unique id of each line with a relationship. Then use a listcombiner (custom transformer) with the source list as the list just generated and the unique id of each line as an additional source and this will create common groupings which you can then use to aggregate your features with.

 

Example with dummy data

Aggregate_by_touch.fmwt


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 29, 2018

@lazarlubomir

 

Looking at your example pic.

Assuming you don't have drawers that somehow relate spatially.

Just use a areabuilder then a dissolver.

LineOnAreaOverlay, Clipper or SpatialRelator the dissolved polygons with the lines. The lines now have common id's.

You might want to separate the diagonal lines from the rest first. Else there is no way of controlling which line piece will get joined. (conveniently bypassed in the previously provided answer by not having a wall thickness, therefore not actually answering the question)


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • November 29, 2018
gio wrote:

@lazarlubomir

 

Looking at your example pic.

Assuming you don't have drawers that somehow relate spatially.

Just use a areabuilder then a dissolver.

LineOnAreaOverlay, Clipper or SpatialRelator the dissolved polygons with the lines. The lines now have common id's.

You might want to separate the diagonal lines from the rest first. Else there is no way of controlling which line piece will get joined. (conveniently bypassed in the previously provided answer by not having a wall thickness, therefore not actually answering the question)

I've presumed that they want a single feature made up of multiple line features aggregated together rather than joined lines


lazarlubomir
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • November 29, 2018

Hello @egomm, @gio,

thank both of you so much! Anyway @egomm solution is right for me, because as he mentioned, I need t ocreate single feature composed by multiple line features aggregated together.

Thank You once again!

Lubo


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