Solved

Add until a certain value is reached

  • 13 January 2020
  • 2 replies
  • 4 views

Badge

Hi there!

 

I am working on a specific analysis. This analysis needs to calculate 13 000 ha of parcels (area) randomly and then assign a new attribute value to this.

Right now I have the following workflow:

I thought I could make this work by calculating the percentage and then use the Sampler to randomly select parcels, but this doesn't work because the sum of ha does not add up.

What I am looking for is a tool that allows me to use the following formula:

"Random amount of parcels added up" = 13 000 ha

So I guess it is a randomized sampler using a certain value based on attribute values.

 

Does anyone have any idea how to do this?

 

Thank you so much in advance!

icon

Best answer by ebygomm 13 January 2020, 11:28

View original

2 replies

Badge

I think it is enough use StatisticCalculator transformer using cumulative port. I wrote a simple example for You

are_added_up.fmw

Userlevel 1
Badge +21

Could you add a random number to all your features, sort by the random number to create a random order, then use the cumulative output of a statistics calculator and test for any cumulative area below 13,000 ha. The ones that pass are your "random amount of parcels"

Reply