Solved

Determine spatial join requestor/supplier based on Feature class feature count

  • 9 September 2019
  • 1 reply
  • 1 view

Badge

Hello,

 

 

I am reading in 2 feature classes into a Spatial Realtor transformer. I need to be able to automatically determine which feature class has the higher number of records/features and which has the lower. This will then determine the Requestor (feature class with higher number), and Supplier (feature class with lower number of records) for the Spatial Relator.

 

 

More like an if statement, if feature class A is 10 and feature class B is 5, then connect A to the Spatial Relator requestor, and B to Spatial Relator supplier.

 

I don't want a new attribute to be created within feature class A or B.

 

How can I do this?

icon

Best answer by fmelizard 10 September 2019, 07:56

View original

1 reply

Userlevel 4
Badge +13

Hi @ani89 One method is attached here - count each group with a StatisticsCalculator, then get the highest summary feature with a Sorter and Sampler, then merge that to all of the features with a FeatureMerger by the group ID. The Merged features will become the Requestor on the SpatialRelator, and the UnmergedRequestor will be the Supplier features. sort_by_count.fmw

Reply