I´m in need to calculate the shortest distance in 3d between a set of basepoints and a line.
Something similar to a Neighborfinder in 3d mode.
Do any of you know a way to do this?
An approach could be that you extract the vertices of the line and then use them and the coordinates of the candidate points to create a 3d line, then get the length of the resulting line. This will give you the shortest distance been a 3d point and a vertex of the line. I’ve attached and example workbench (2024.1)
If you want to find the closest point along the line, you could use the Densifier to emulate segment snapping. This will make a heap of vertices along your line and will get exponentially slower as your line gets longer.
I’ve done a previous Proof-of-Concept using Spatialite, which does support 3D closest distance calculations. It isn’t fully “within” FME, however,
Noted is that there is also a Community Hub Transformer 3DAnchoredSnapper that could also work, but not tested. This could output a point on the line that is closest to the origin node, and then can calculate the distance between the origin point and the snapped point.
An approach could be that you extract the vertices of the line and then use them and the coordinates of the candidate points to create a 3d line, then get the length of the resulting line. This will give you the shortest distance been a 3d point and a vertex of the line. I’ve attached and example workbench (2024.1)
If you want to find the closest point along the line, you could use the Densifier to emulate segment snapping. This will make a heap of vertices along your line and will get exponentially slower as your line gets longer.
Thanks I think this will work for me
I’ve done a previous Proof-of-Concept using Spatialite, which does support 3D closest distance calculations. It isn’t fully “within” FME, however,
Noted is that there is also a Community Hub Transformer 3DAnchoredSnapper that could also work, but not tested. This could output a point on the line that is closest to the origin node, and then can calculate the distance between the origin point and the snapped point.
Interesting, I will have a look at the 3DAnchoredSnapper...