Skip to main content
Solved

Spatial Filter attribute priority?

  • August 20, 2019
  • 5 replies
  • 63 views

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)

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

matt_banyard
  • 4 replies
  • August 20, 2019

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
  • 4 replies
  • August 20, 2019

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+37
  • Contributor
  • 2002 replies
  • 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
  • 2 replies
  • 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)

 

 

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+37
  • Contributor
  • 2002 replies
  • August 20, 2019

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.