Skip to main content

HI. I have one point layer that contains residential locations. The second layer contains the location of fast food outlets. I want to create a distance weighted count of nearby fast food outlets such that:

  • outlets nearer than 500 metres away get a weight of 1
  • outlets more than 2000 metres away get a weight of 0
  • those between 500 and 200 metres get a weight of 500/distance

 

Could anyone tell me if this is this possible in FME please?

Use NeighborFinder in which you enter a value for Number on Neighbors to Find (10, 100? You have to figure it out or put a sufficient value to get everything in 2000m), Maximum Distance 2000m and select Generate List.

Send that to ListExploder and use distance (not _distance) to create a Conditional Value based attribute with your desired values.

 


Use NeighborFinder in which you enter a value for Number on Neighbors to Find (10, 100? You have to figure it out or put a sufficient value to get everything in 2000m), Maximum Distance 2000m and select Generate List.

Send that to ListExploder and use distance (not _distance) to create a Conditional Value based attribute with your desired values.

 

Many thanks for your answer. I've got it all working up to the ListExploder part, and now have a table with the base and candidate locations with distance. Could you explain in more detail which Transformer I use to create the aggregation of this using my calculation please?


Create an attribute via AttributeCreator that is the weight of distance as you described:

AttributeCreator conditional valueAnd set up like this:AttributeCreator conditional value by distanceThen you need to specify what you want to aggregate.

If you need a normalized indicator of how many fast foods you have in a given location just use Aggregator with GroupBy enabled and set to the Location ID attribute and specify the attribute to sum or to average depending on what you need (the weight attribute that you calculated earlier)

Aggregator GroupBy


Many thanks for your answer. I've got it all working up to the ListExploder part, and now have a table with the base and candidate locations with distance. Could you explain in more detail which Transformer I use to create the aggregation of this using my calculation please?

I figured it out: don't know if this is the best way though!

 

I used ExpressionEvaluator to create a new column with formula min(1,500/distance) and then used StatisticsCalculator to sum that column grouped by my Base locations.


Many thanks for your answer. I've got it all working up to the ListExploder part, and now have a table with the base and candidate locations with distance. Could you explain in more detail which Transformer I use to create the aggregation of this using my calculation please?

Congratulations for figuring it out.

I hope you realized that without any sample data we can't really tell if what we post is OK for you're case 🙂


Reply