Skip to main content

I had two features that both had FME Geometry of single point that I merged together with FeatureJoiner. The result of join I have single feature with FME Aggregate, with both points inside that. My question is that I want to get the distance (preferred in feet) between the two points that are now inside a FME Aggregate. 

 

I figure the easiest way to do this is with Python caller. I tried looking at the forum question below calling Python. However, I couldn't determine how to use it to get both my FME Points out of FME Aggregate. https://community.safe.com/s/question/0D54Q00008z6yR3SAI/distance-calculation-per-pipe-segment

 

If there are other suggestions, please let me know.

 

I'm attaching a sample FFS file with the data points. Can open and see the features each have FME aggregate with two FME points inside that.

Why not join the points with a LineBuilder (group by whatever attribute you are using in your FeatureJoiner) and then measure the line rather than creating aggregates?


The reason this doesn't work is in some cases I have multiple Suppliers to single Requestor. I use the FeatureJoiner with Left Join and this will create me two separate features, each with a set of two points in the FME Aggregate. After this transformer, If I did a LineBuilder with group by, it is going to try and group all the points sharing same ID I used for FeatureJoiner into a single line. Which I don't want.


After using the above suggestion I finally solved the issue using LineBuilder. However I needed to add a unique key before the FeatureJoiner for all my Suppliers. I could then do the FeatureJoiner with same attributes as before. Then in the LineBuilder I could again use those same attributes I used in FeatureJoiner plus the unique key attribute I created to the GroupBy, to keep separate results.

 

The distance was then done with GeographicLengthCalculator.


Reply