Skip to main content
Solved

Spatial Filter attribute priority?


I'm using a Spatial Filter and want to understand how the merge attributes element deals with multiple features.

In the example attached the 'orange' grid is the candidate and the 'green' features the filter, with dark green feature A and light green feature B in that one dataset. For the highlighted purple square the following is true:

  • The cell would pass, because it intersects the 'green' layer.
  • It outputs the purple square attributes with the addition of A (dark green), (NOT B (light green))

My question is - How is it decided which attribute value from the 'green' data set is used (A or B)? the first it intersects, the largest feature or something else?

 

Apologies if this has been asked before I couldn't figure it out from the help file, or how best to pose the question on Google!

 

Thanks.

Best answer by jdh

The first filter feature in wins. As soon as a candidate passes against one filter , those attributes are transferred and the feature is kicked out the passed port.

 

 

If you can't sort your filters, you can use a SpatialRelator instead which can add the attributes of all intersecting features as a list, which you can then sort to determine which attributes to transfer. (by feature type, largest area, some other attribute, etc)

 

 

View original
Did this help you find an answer to your question?

5 replies

matt_banyard
matt_banyard wrote:

Hi - is there a way in your dataset to filter the green records beforehand into A and B (dark and light green) using a tester/testfilter or similar?

Then run 1 x spatialfilter against the feature A's

Then a second spatialfilter against the feature B's

 

Alternatively, i think Spatialrelator might be worth a look

 

I'd think that's a sensible way of getting around it - but doesn't truly answer the question as to why it happens/how it is decided.

I'd expect it's simply order that the feature hits the transformer in - so you could control this with sorting beforehand

 


matt_banyard

Hi - is there a way in your dataset to filter the green records beforehand into A and B (dark and light green) using a tester/testfilter or similar?

Then run 1 x spatialfilter against the feature A's

Then a second spatialfilter against the feature B's

 

Alternatively, i think Spatialrelator might be worth a look

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • August 20, 2019

The first filter feature in wins. As soon as a candidate passes against one filter , those attributes are transferred and the feature is kicked out the passed port.

 

 

If you can't sort your filters, you can use a SpatialRelator instead which can add the attributes of all intersecting features as a list, which you can then sort to determine which attributes to transfer. (by feature type, largest area, some other attribute, etc)

 

 


  • Author
  • August 20, 2019
jdh wrote:

The first filter feature in wins. As soon as a candidate passes against one filter , those attributes are transferred and the feature is kicked out the passed port.

 

 

If you can't sort your filters, you can use a SpatialRelator instead which can add the attributes of all intersecting features as a list, which you can then sort to determine which attributes to transfer. (by feature type, largest area, some other attribute, etc)

 

 

That makes sense that is first in - is that mentioned/recorded in the documentation anywhere?

Ideally I would take the attributes of the majority/largest intersecting feature. But presumably when you say largest area you mean the input features? To calculate largest area of the 'green' dataset in each 'orange' cell is probably going to need a clipper and some extra steps right?


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 20, 2019
mesmath wrote:

That makes sense that is first in - is that mentioned/recorded in the documentation anywhere?

Ideally I would take the attributes of the majority/largest intersecting feature. But presumably when you say largest area you mean the input features? To calculate largest area of the 'green' dataset in each 'orange' cell is probably going to need a clipper and some extra steps right?

In this scenario, yes it would be area of the original feature, not the overlapping area.

Clipping the green features by the orange features prior to the spatialRelator would work for scenarios where the orange features themselves have no overlaps.

 

 

If they do, you would probably need to do something involving UniqueIDs, AreaOnAreaOverlayer (with list), AreaCalculator, ListExploder/Cloner, Aggregator (group by on foreign key, sum area), FeatureMerger back on original orange features, with list, sort list to get largest overlapping area.

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