Skip to main content
Question

Spatial Relator/Filter: How to get it to merge the maximum attribute value


Forum|alt.badge.img

I have two shapefiles populated by polygons, where several polygons of the second (Supplier) shp intersect the first (Requestor). When it does the Spatial relations and merges the attributes I need it to pick of the maximum attribute value of all the polygons that intersect the Requestor. Basically performing the Join attribute function in other softwares by spatial location picking the maximum value of the Supplier polygons intersecting the Requestor polygon, but can't figure out a way to do so. Does anyone know of a way around this? Thanks.

A diagram might help, so I need a transformer that reads that there are three gardens intersecting the property and then to pick up the maximum cost of the garden and merge it into the output attribute list. It's the last bit I'm struggling with.

5 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • July 11, 2018

Hi @patrialvarollop

Enable this option on transformer SpatialRelator:

After use the other transformer StatisticsCalculator to get the max value from _related_candidates.

thanks,

Danilo


Forum|alt.badge.img

Hi @danilo_fme, thanks for the suggestion, but that's not what I meant, that tells me the max number of related candidates. I need it to pick the maximum attribute from the original Supplier, I'll add a comment to make myself clearer.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 11, 2018

@patrialvarollop

Have the SpatialRelator generate a list (just under the tip @danilo_fme)

In fme2018 you can choose the attribute you want to list (finally! and tx Safe)

Sort (descending) the list by the attriubute you want to test and use ListIndexer with index = 0 to get the value.

(remove list when you are done)


Forum|alt.badge.img
gio wrote:

@patrialvarollop

Have the SpatialRelator generate a list (just under the tip @danilo_fme)

In fme2018 you can choose the attribute you want to list (finally! and tx Safe)

Sort (descending) the list by the attriubute you want to test and use ListIndexer with index = 0 to get the value.

(remove list when you are done)

That worked! Thanks both, @gio, @danilo_fme. Results slightly differ from the outputs I get when I do it in ArcGIS, anyone knows why this could be?

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 11, 2018
patrialvarollop wrote:
That worked! Thanks both, @gio, @danilo_fme. Results slightly differ from the outputs I get when I do it in ArcGIS, anyone knows why this could be?
How do they differ?

 

One possibility could be that ArcGIS is a little fuzzier in the tolerances for what it considers intersecting. So a garden that almost, but not quite intersects the house would not be considered by FME, but would by ArcGIS.

 

 


Reply


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