Question

Extend Line to center of circle


Badge +9

Hello All,

I have an AutoCAD drawing that has small circles (polygons) sitting over the intersection of two or more lines. The lines finish at the edge of the circle but I need to extend each of the lines to the centre of the circle so I can then create polygon features from the lines. The resulting line from circle edge to centre needs to be merged with the original line i.e. not just create a new line segment.

Any ideas would be very much appreciated.

 

 


28 replies

Badge +2

Use CenterPointExtractor to extract the center point of the circle

SpatialRelator/filter to transfer the center point of circle to line and edit first/last vertex of the line

Badge +9

Use CenterPointExtractor to extract the center point of the circle

SpatialRelator/filter to transfer the center point of circle to line and edit first/last vertex of the line

Thanks @pratap, they are the features I am trying but just need to get the right sequence to get the spatial join to work on the correct line features. If anyone has any similar examples that would be very much appreciated so I can see how the transformers need to be coupled.

Badge +2

Thanks @pratap, they are the features I am trying but just need to get the right sequence to get the spatial join to work on the correct line features. If anyone has any similar examples that would be very much appreciated so I can see how the transformers need to be coupled.

@deanhowell2009 I have mentioned in sequence as it should be... If it is not meeting the requirement then plz post some screenshot to understand better

Badge +9

Thanks @pratap, your suggestions was close to what I was able to achieve but for some reason the SpatialRelator didn't pick up the lines I needed but used the neighbor finder instead. It worked like a charm.

 

 

Badge +9

Thanks @pratap, I got it to work with a slight variation using the NeighborFinder instead.

Badge +2

Thanks @pratap, I got it to work with a slight variation using the NeighborFinder instead.

Good to hear... Thank you for update

Badge +2

I think CenterPointReplacer and AnchorSnapper are probably a good alternative here. See the attached workspace (2019): anchorsnapper.fmw

Badge +9

I think CenterPointReplacer and AnchorSnapper are probably a good alternative here. See the attached workspace (2019): anchorsnapper.fmw

Thanks @markatsafe, I will check it out. It the great thing about FME that there are multiple options to do things.

Badge +9

Hello again everyone, the solutions listed above go some way to working but have discovered two issues that if anyone has ideas it would be very much appreciated.

The two new issues are

1. If there is a circle at each end of the line, how do I ensure it extends in both directions, but only for those with one at each end not all?

2. How do I find the index that is closest to the circle center so the line is extended from the correct end of the line?

Thanks again

 

Badge +2

Hello again everyone, the solutions listed above go some way to working but have discovered two issues that if anyone has ideas it would be very much appreciated.

The two new issues are

1. If there is a circle at each end of the line, how do I ensure it extends in both directions, but only for those with one at each end not all?

2. How do I find the index that is closest to the circle center so the line is extended from the correct end of the line?

Thanks again

 

Its better you place some screenshots to understand better

Badge +9

Its better you place some screenshots to understand better

Here is an example of where the circles are at both ends of the line. You can see that the line has extended in one direction but not both.

Badge +9

Here is an example of where the circles are at both ends of the line. You can see that the line has extended in one direction but not both.

 

This is a little harder to see but the highlight line in orange should be approximately 30 meters but FME calculated it as 60. What I discovered was the add vertex is adding at the new vertex at the start of the line, which in this example is the point on the left of the screen not the right. For some that is fine so it is not a matter of just changing the index point but trying to figure out which index point to change.

Badge +2

Its better you place some screenshots to understand better

is the understanding is correct?

Badge +9

is the understanding is correct?

Yes @pratap that is correct. The result is that the lines outside the circle are extended to the center.

Badge +2

Yes @pratap that is correct. The result is that the lines outside the circle are extended to the center.

@deanhowell2009 Have a look at source I have used and the logic I used

Hope this is suffice

Execute with the source I have provided to review and change the source with your data

ws.fmwdrawing1.dwg

Badge +9

@deanhowell2009 Have a look at source I have used and the logic I used

Hope this is suffice

Execute with the source I have provided to review and change the source with your data

ws.fmwdrawing1.dwg

You are a champion @pratap. This has got to be the best forum around :)

Badge +2

You are a champion @pratap. This has got to be the best forum around :)

Good to hear your response

Thanks... :)

Badge +2

I think CenterPointReplacer and AnchorSnapper are probably a good alternative here. See the attached workspace (2019): anchorsnapper.fmw

@deanhowell2009 I've revised the AnchorSnapper workspace (2019): anchorsnapper2.fmwt

Badge

Hi All,

 

I have this exact same issue, including the two-ends extension part, but none of the example workbenches that were in this answer are attached any more - is there any way the examples can be re-attached? I'd really love to not have to re-invent the wheel! @deanhowell​  @pratap​ @Mark Stoakes​ ??

 

Thank you in advance!

Katrina

Badge +9

Hi All,

 

I have this exact same issue, including the two-ends extension part, but none of the example workbenches that were in this answer are attached any more - is there any way the examples can be re-attached? I'd really love to not have to re-invent the wheel! @deanhowell​  @pratap​ @Mark Stoakes​ ??

 

Thank you in advance!

Katrina

Hello @katrinaopperman​ I will dig up the solution we used and post it here for you.​

Badge

Hello @katrinaopperman​ I will dig up the solution we used and post it here for you.​

Thank you!

Badge +2

@katrinaopperman​ Could you kindly post sample data to understand the problem along with required output.

Thank you

Badge

@katrinaopperman​ Could you kindly post sample data to understand the problem along with required output.

Thank you

Hi @pratap​ ,

It's exactly as described above. I have cables in dwg format that are drawn to meet the edge of a circle that is the manhole for them. In order to convert them to a GIS dataset, I need to extend the cables from the edge of the circle to snap to the centrepoint of that circle so they can join to other cables. Some have manholes at both ends of the cable, some only have a manhole at one end. It is precisely the example you provided when you ask if your understanding is correct in the drawing above. I am just after the example workspaces you posted in this thread so that I can modify to fit my version of events (I sometimes have two parallel cables running to the same manhole, so might need to finesse a bit).

Thank you in advance!

Badge +9

Hello @katrinaopperman​ I will dig up the solution we used and post it here for you.​

Hello @katrinaopperman​ here is a truncated version of our model which just contains the bits around the line and circle process. In our case we had a survey drawing coming in which had a layer called 'Pops' which are the circles over the end of lines. In our case the pops represent a slight change in angle of the line but have a line come in to the edge of the circle. If you would like more explanation just let me know and we can set up a teams meeting and I will demo what our model does.

Badge +9

Hello @katrinaopperman​ I will dig up the solution we used and post it here for you.​

Just to give credit where credit is due, our solution was very much based on the suggestions by @pratap​ 

Reply