Solved

Spatial Filter Looping - Creating a feature for every filter it intersects

  • 27 April 2018
  • 2 replies
  • 15 views

Hi.

I have a database of roughly a million polygons and I have another dataset of 50 polygons which represent areas of interest. Some of these areas of interest overlap.

I would like to select every feature from the large database that overlaps an area of interest polygon and write these to 50 individual datasets. I tried to set up a loop using a spatial filter. Some screenshots are below

Overlapping areas of interest

Main workbench

Custom transformer

I should let you know I haven't worked with loops before in FME before. I was hoping the first area of interest polygon would enter the filter then the large database would enter the candidate path. It would select the correct polygons. The passed and failed features would enter back through the candidate path and it would perform the same operation on the next filter polygon.

Any help would be greatly appreciated.

Thanks,

Matt

icon

Best answer by takashi 27 April 2018, 18:19

View original

2 replies

Userlevel 2
Badge +17

Hi @mattenvsys, why not use the SpatialRelator?

  1. Send the 50 polygons to the Requestor port,
  2. send the areas from the large dataset to the Supplier port,
  3. check the Generate List checkbox,
  4. and select attributes which you want to collect from spatially related suppliers for each requestor.
The SpatialRelator with the setting above collects attributes from all the related suppliers for each requestor and stores them into the list. You can then extract desired attribute values from the list.

Hi @mattenvsys, why not use the SpatialRelator?

  1. Send the 50 polygons to the Requestor port,
  2. send the areas from the large dataset to the Supplier port,
  3. check the Generate List checkbox,
  4. and select attributes which you want to collect from spatially related suppliers for each requestor.
The SpatialRelator with the setting above collects attributes from all the related suppliers for each requestor and stores them into the list. You can then extract desired attribute values from the list.
Hi @takashi,

 

 

I used your suggestion and it worked. I finished off the workbench with a ListExploder and FeatureMerger to pull out the features from the large database.

 

 

Thanks for your help!

 

 

Reply