Skip to main content
Question

Comparing distance between two Points inside a FME Aggregate.


ssmith_ftr
Contributor
Forum|alt.badge.img+6

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.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • July 5, 2022

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?


ssmith_ftr
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 5, 2022

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.


ssmith_ftr
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 6, 2022

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings