Skip to main content
Solved

Spatial filter not working when I use the entire dataset.

  • December 15, 2023
  • 6 replies
  • 143 views

rwnewcs
Contributor
Forum|alt.badge.img+3

When I run my spatial filter with the entire dataset the filter fails but if I run using partial data the dataset it works.

Does anyone know why this would happen?

Note: Spatial Realtor works but not the spatial filter.

Best answer by joepk

I tried Multiple settings in the spatial filter. Filter type = 'Multiple', Pass Criteria = 'Pass Against All Filters' and Spatial Predicates to Test = 'Within' and 'Intersects'

Also, Filter type = 'Single Filter', Pass Criteria = 'One Filter' and Spatial Predicates to Test = 'Intersects'

As for the realtor I only tried it using all of the Requestor OGC options.

 

When I say failed I am referring to the Passed/Failed outputs in the spatial filter transformer.

If you set your SpatialFilter to "Pass against all filters" it means that your candidate feature must have a spatial relationship (intersect or within) with all the features in the filter port. E.g:

I have set my SpatialFilter to "Filter OGC-Intersects Candidate" and "Pass Against All Filters"

imageJust the middle square of my Candidate features (in pink) passes, since that is the only feature that intersects all 4 Filter features (in green).

 

Hope this helps.

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.

6 replies

j.botterill
Influencer
Forum|alt.badge.img+54
  • Influencer
  • December 18, 2023

A few ideas to test:

  1. what settings on spatial filter do you have? https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Transformers/spatialfilter.htm# read up about the Tests>Filter Types about how to process filter vs canditate
  2. add a decelerator (0.2sec) and find out where the features are accumulating.... you may want to place a featureHolder somewhere if you can't get the setting in 1. optimised

joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • December 18, 2023

We also kind of need the settings of both your SpatialFilter and the SpatialRelator. And what do you mean with 'the filter fails'?


rwnewcs
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • December 18, 2023

We also kind of need the settings of both your SpatialFilter and the SpatialRelator. And what do you mean with 'the filter fails'?

I tried Multiple settings in the spatial filter. Filter type = 'Multiple', Pass Criteria = 'Pass Against All Filters' and Spatial Predicates to Test = 'Within' and 'Intersects'

Also, Filter type = 'Single Filter', Pass Criteria = 'One Filter' and Spatial Predicates to Test = 'Intersects'

As for the realtor I only tried it using all of the Requestor OGC options.

 

When I say failed I am referring to the Passed/Failed outputs in the spatial filter transformer.


joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • Best Answer
  • December 18, 2023

I tried Multiple settings in the spatial filter. Filter type = 'Multiple', Pass Criteria = 'Pass Against All Filters' and Spatial Predicates to Test = 'Within' and 'Intersects'

Also, Filter type = 'Single Filter', Pass Criteria = 'One Filter' and Spatial Predicates to Test = 'Intersects'

As for the realtor I only tried it using all of the Requestor OGC options.

 

When I say failed I am referring to the Passed/Failed outputs in the spatial filter transformer.

If you set your SpatialFilter to "Pass against all filters" it means that your candidate feature must have a spatial relationship (intersect or within) with all the features in the filter port. E.g:

I have set my SpatialFilter to "Filter OGC-Intersects Candidate" and "Pass Against All Filters"

imageJust the middle square of my Candidate features (in pink) passes, since that is the only feature that intersects all 4 Filter features (in green).

 

Hope this helps.


joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • December 18, 2023

I tried Multiple settings in the spatial filter. Filter type = 'Multiple', Pass Criteria = 'Pass Against All Filters' and Spatial Predicates to Test = 'Within' and 'Intersects'

Also, Filter type = 'Single Filter', Pass Criteria = 'One Filter' and Spatial Predicates to Test = 'Intersects'

As for the realtor I only tried it using all of the Requestor OGC options.

 

When I say failed I am referring to the Passed/Failed outputs in the spatial filter transformer.

Also, have a look at this page: Spatial Relations Defined. This might help with choosing which OGC test is best for your data. For example, the "Intersects" test also includes the "Within" test.


rwnewcs
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • December 18, 2023

I tried Multiple settings in the spatial filter. Filter type = 'Multiple', Pass Criteria = 'Pass Against All Filters' and Spatial Predicates to Test = 'Within' and 'Intersects'

Also, Filter type = 'Single Filter', Pass Criteria = 'One Filter' and Spatial Predicates to Test = 'Intersects'

As for the realtor I only tried it using all of the Requestor OGC options.

 

When I say failed I am referring to the Passed/Failed outputs in the spatial filter transformer.

I've got it now. I was confused by the transformer parameters. I thought all of the 'Tests' where referring to the 'Spatial Predicates to Test'. I didn't realize the 'Filter Type' and 'Pass Criteria' are referring to the input by which I am filtering the candidate.

Thank you for clearing that up for me.