Skip to main content
Solved

SpatialFilter, unstabel if filter first is turned on. bug?

  • March 4, 2025
  • 1 reply
  • 33 views

wrijs
Contributor
Forum|alt.badge.img+3
  • Contributor

Hi,

It seems that the SpatialFilter does not always work as expected when the Filters First option is enabled. I have taken several steps to fix the incoming data (such as using the GeometryValidator and applying reprojections), but the SpatialFilter only works consistently when the Multiple Filters option is enabled.

Below, I have included an image of my workbench, where—after multiple test attempts—only the top SpatialFilter suddenly works as expected.

Is this a bug?

I am comparing .dwg files with a feature class in a geodatabase (area)

I work with the DataInteroperability extention by ESRI, in a workbench created outside of ArcGIS PRO,

FME(R) 2024.0.1.0 (20240328 - Build 24202 - WIN64)

 

 

Best answer by nielsgerrits

From the documentation:

Filter Type

Defines whether a single filter or multiple filters will be given, as well as clarifies the feature order that is expected.

  • Multiple Filters – the SpatialFilter assumes Candidate and Filter features may come in any mixed order, and must wait until all features have entered before performing any filtering.
  • Filters First – the SpatialFilter assumes that all Filter features enter before any Candidate features, and will be able to process the Candidate features immediately as they arrive.
  • Single Filter – the SpatialFilter assumes that after the first and only Filter feature has entered, only Candidate features will enter, and will be able to process the Candidate features immediately as they arrive.

 

When set at Filters First, it processes the candidates the moment they enter the SpatialFilter. This can speed up the process as the default, Multiple Filters, waits until all Filters and Candidates have reached the SpatialFilter, this way being a blocking transformer.

So to use this, you need to make sure the filters enter the SpatialFilter before the Candidates, else the candidates will be processed against no filters and being output through the Failed outputport.

You can try this by creating an attribute “order” for filters with value 1 and candidates with value 2, then use a sorter to make sure filters are first and then split filters and candidates using a tester and feed them into the SpatialFilter.

I see you use classic readers. I believe the order of the readers in the navigator determine the order the features are read. So I think the solution for your issue is to change this order. But I never use classic readers, so I might be wrong. Another reason I prefer FeatureReaders over classic readers.

Another way to influence feature order is to right click on a connection where multiple connection come from and click Set Connection Runtime Order...

 

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

1 reply

nielsgerrits
VIP
  • Best Answer
  • March 4, 2025

From the documentation:

Filter Type

Defines whether a single filter or multiple filters will be given, as well as clarifies the feature order that is expected.

  • Multiple Filters – the SpatialFilter assumes Candidate and Filter features may come in any mixed order, and must wait until all features have entered before performing any filtering.
  • Filters First – the SpatialFilter assumes that all Filter features enter before any Candidate features, and will be able to process the Candidate features immediately as they arrive.
  • Single Filter – the SpatialFilter assumes that after the first and only Filter feature has entered, only Candidate features will enter, and will be able to process the Candidate features immediately as they arrive.

 

When set at Filters First, it processes the candidates the moment they enter the SpatialFilter. This can speed up the process as the default, Multiple Filters, waits until all Filters and Candidates have reached the SpatialFilter, this way being a blocking transformer.

So to use this, you need to make sure the filters enter the SpatialFilter before the Candidates, else the candidates will be processed against no filters and being output through the Failed outputport.

You can try this by creating an attribute “order” for filters with value 1 and candidates with value 2, then use a sorter to make sure filters are first and then split filters and candidates using a tester and feed them into the SpatialFilter.

I see you use classic readers. I believe the order of the readers in the navigator determine the order the features are read. So I think the solution for your issue is to change this order. But I never use classic readers, so I might be wrong. Another reason I prefer FeatureReaders over classic readers.

Another way to influence feature order is to right click on a connection where multiple connection come from and click Set Connection Runtime Order...

 


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