FME – Calculate Distance of Point Along a Line in FME

fmelinear-referencing

I have created an FME workspace which inputs a pipeline as well as other linear features which cross it (waterways, roads, railways, fences, other pipelines, etc). The output is a point file which contains the crossing type. What I would like to do is calculate the distance along the pipe from the start of the pipeline for each intersection. So, as you travel along the pipeline, the distance attribute will increase.

I'm thinking that I'll need to use some of the linear referencing tools like MeasureGenerator, MeasureExtractor, or something like that, but I'm not sure how to do so.

Does anyone have an idea of how to do this?

Best Answer

I believe you can use LengthToPointCalculator transformer. But you have to do some additional preparations:

  1. Extract point coordinates to attributes with CoordinateExtractor.
  2. Merge line feature with points (FeatureMerger). You need to receive one feature for each point with line geometry and original point's coordinates in the attributes. Use GeometryExtractor/GeometryReplacer.

Model will be similar to:

enter image description here

You can download my test model with data here: example.

Related Question