Solved

How would you join collinear lines that have gaps within specific ranges?


Badge +5

Hello, I asked the above question in the New To FME forum, but no takers. Lets see what happens here.

 

My goal is to join CAD wall lines that are collinear and have a gap where the door is located (usually 36"). The LineBuilder does not have a conditional option.

 

Two ways I can think of pursuing are:

  • Group collinear lines that have a gap of 36" between end-point of one line and start-point of another. Lines have all been changed to a positive vector, so end-points are followed by start-points on X or Y axis.
  • Use the CAD Door layer to locate prospective lines. These door symbols are blocks with an insertion point at the hinge. Very standard.

 

Here is a screenshot, attached, of a typical hallway. There are large gaps which should be ignored and others that are approx. 36". On the left, you see two door setbacks.

It is not a problem to separate horiz and vert lines if needed.

 

Any help is appreciated.

 

Thanks,

@larue

icon

Best answer by larue 22 December 2021, 06:26

View original

8 replies

Badge +11

Hi larue, since you know the distance (36"), have you tried the Snapper with snapping type 'End Point Snapping'? Use the LineCombiner afterwards, possibly with a GroupBy parameter.

Badge +5

Hi larue, since you know the distance (36"), have you tried the Snapper with snapping type 'End Point Snapping'? Use the LineCombiner afterwards, possibly with a GroupBy parameter.

Hi @Jelle De Zwaef​ , Thanks for the response. Yes, I tried Snapper but it doesn't snap orthogonally, so I got angled lines instead of collinear. If there was a way to keep the lines straight, that might work.

Badge +11

Hi @Jelle De Zwaef​ , Thanks for the response. Yes, I tried Snapper but it doesn't snap orthogonally, so I got angled lines instead of collinear. If there was a way to keep the lines straight, that might work.

The LineExtender keeps the line straight, but I doubt that this will be a solution in your case.

Use 'segment snapping' instead of 'end point snapping' for these cases where it has to be orthogonal?

 

Badge +5

Hi @Jelle De Zwaef​ , Thanks for the response. Yes, I tried Snapper but it doesn't snap orthogonally, so I got angled lines instead of collinear. If there was a way to keep the lines straight, that might work.

Sorry, it did not work. I am experimenting with another way to fill the 36in. gap: You take the door symbol geometry and create a line using the points that touch the wall lines. So far so good. This also prevents extending lines where it should not. Now, just have to offset that line the correct distance of wall thickness and join. That's another challenge ! Stay tuned.

Best,

@larue​ 

 

Userlevel 2
Badge +17

Hi @Jelle De Zwaef​ , Thanks for the response. Yes, I tried Snapper but it doesn't snap orthogonally, so I got angled lines instead of collinear. If there was a way to keep the lines straight, that might work.

Hi @larue​ ,

 

When you are snapping the door lines to the walls, you may want to try the AnchoredSnapper, with the walls as the anchor. This will prevent the wall lines from moving, keeping them straight. If you could generate lines from the doors that are the centerlines, you can use the Bufferer to expand them out into wall polygons, then merge them into the walls with a Dissolver.

Badge +5

Hi @Jelle De Zwaef​ , Thanks for the response. Yes, I tried Snapper but it doesn't snap orthogonally, so I got angled lines instead of collinear. If there was a way to keep the lines straight, that might work.

Hi @daveatsafe​ ,

I did try the AnchoredSnapper, but maybe I had the configuration wrong. Will give it another go. My concern is that it may snap where it should not.

 

One solution that worked for me is to create lines from door block points, then clone and offset using the distance calculated from baseline and candidate x and y values depending if the wall was horiz or vert, using NeighborFinder. Kind of complicated, but it worked!

I have attached the end result. Still need to combine/dissolve the lines, as well as deal with other gap conditions.

 

I am not sure what you mean by a door centerline. Maybe I can apply a Bufferer to my door line experiment in lieu of offset? To be clear, there are no polygons yet, just lines. Once I close all the gaps, then they can be converted, yes?

 

Thanks for the tips, we are heading in the right direction!

Best,

 

@larue​ 

Badge +5

Separating lines orthogonally and using neighborfinder to id the closest endpoint worked for me. TopologyBuilder was helpful to locate danglers. Making sure lines all had a positive vector was important. In some instances, the SmartCleaner did a great job, which is how I learned about Topology Builder.

Hi,

I had kind of the same problem with my stream data. I wasn't happy with the original snapping. Originally there were 7 named streams in my data, but after opening it in FME this brilliant software pointed out problems to me in the data 🙂 ;) More than 7 objects in there... I have to make a new table with attributecreator and -manager, but this below helped me. Snapping distance: you just need to test what distance (in meters in my data) is working the best for your end result. In the end I got back to the number 7... 🙂

combine lines in fmeBr,

 

K

Reply