Skip to main content
Solved

How to assign merge rules to SpatialFilter ?

  • May 15, 2014
  • 2 replies
  • 18 views

makt
Contributor
Forum|alt.badge.img+1
I am doing a spatial join by intersect of points to areas (joining an attribute of the points to the attribute of areas). SpatialFilter does what I want exept when there is more than one point that intersects an area. The point attribute that is joined seems to be the max of the candidates but I would like the average. 

 

 

I explored all the settings in SpatialFilter and there does not seem to be any parameter that sets the merge rules for this kind of situation. Do I need to bring in another transformer to join the average value rather than the default max value?

 

 

Best answer by takashi

Hi,

 

 

The fundamental functionality of the SpatialFilter is to filter candidate features by spatial relationships to at least one base feature, so it doesn't have options to collect multiple related features and calculate somthing.

 

In your case, consider using the SpatialRelator instead.

 

Send the areas to BASE (Requestor in FME 2014), the point to CANDIDATE (Supplier) port of the SpatialRelator. Output features are area features, each of which will have a structured list attribute named "_relationships" by default. The list contains all attributes of every spatially related points, so you can calculate average of any attribute value base on the list elements. The ListSummer and the ListElementCounter might help you when calculating.

 

 

Takashi
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.

2 replies

takashi
Celebrity
  • Best Answer
  • May 16, 2014
Hi,

 

 

The fundamental functionality of the SpatialFilter is to filter candidate features by spatial relationships to at least one base feature, so it doesn't have options to collect multiple related features and calculate somthing.

 

In your case, consider using the SpatialRelator instead.

 

Send the areas to BASE (Requestor in FME 2014), the point to CANDIDATE (Supplier) port of the SpatialRelator. Output features are area features, each of which will have a structured list attribute named "_relationships" by default. The list contains all attributes of every spatially related points, so you can calculate average of any attribute value base on the list elements. The ListSummer and the ListElementCounter might help you when calculating.

 

 

Takashi

makt
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • May 16, 2014
Thanks for the tip - works great!