Skip to main content

Hi,

 

I'm wondering if something is possible at all in FME.

 

I have two parallel 3D lines on a railroad. A "left" line and a "right' line.

I want to create a new line at the center of these two lines (the railroad center)

Once this is done I would like to resample all three lines together so that they all have vertexes that are perpendicular to the center line.

 

This is exactly what the Topodot tool "center line extraction" does if you adjust element vertices. I was wondering if it is possible to do in FME so I can automate it. I don't have any python skills to make something

 

The result would look like this

image.png 

Any advice would be appreciated

Thanks

Hi @james_c_452​,

This looks like an interesting exercise. Would you be able to share some samples of these railway lines for testing?


Hi @james_c_452​,

This looks like an interesting exercise. Would you be able to share some samples of these railway lines for testing?

Hi @daveatsafe​ ,

Here is a small sample of some rail lines before I used the other tool I was talking about. Which makes a centerline, and can adjust the vertices to 1m so they are aligned with each other like the picture above


Hi @daveatsafe​ ,

Here is a small sample of some rail lines before I used the other tool I was talking about. Which makes a centerline, and can adjust the vertices to 1m so they are aligned with each other like the picture above

Hi @james_c_452​,

The distance between the rails is fixed and the curves are smooth, so the OffsetCurveGenerator may do a good job. You will need to separate the left and right rails, then use only one side to the generate the appropriate offset for the centerline.


Hi @daveatsafe​ ,

I don't think that tool will work in this case. In the past I have used it and it created a 2D line. What I'm after is a new center line in 3D midway between the left and right rails. The left and right rails don't have a consistent distance apart. There is some different how they have laid track and there are differences in height around corners

Thanks


Hi @james_c_452​ 

This one is indeed interesting. I do not think it's perfect, but I came up with the following method. I have attached the workbench.

Be aware that the Z values are interpolated and that the resampled vertices don't always have the 1 meter interval, especially at the end of the line.Screenshot 2023-03-05 195531


Hi @james_c_452​ 

This one is indeed interesting. I do not think it's perfect, but I came up with the following method. I have attached the workbench.

Be aware that the Z values are interpolated and that the resampled vertices don't always have the 1 meter interval, especially at the end of the line.Screenshot 2023-03-05 195531

Hi @markvv​ ,

That's pretty good thanks! Seems to work pretty well. I worked out how to remove the weird ends of lines (Join a vertex to the next vertex, calculate line lengths, remove anything not between 0.99-1.01, then make the lines).

However there is a random problem in the middle of another file I tested. It seems the left/right/centre attribute has got all muddled leading to some funny results. Do you know why this is doing this? I haven't found where in your workspace is causing this


Reply