Skip to main content

We have a selection of roughly 40,000 Uber H3 Hexagons.

 

From this set we need to randomly choose 10 hexagons to perform a survey within, and would like to then select 10 more hexagons as alternates should one of the original 10 not be suitable for survey.

 

Our first attempt used two Samplers. The first Sampler selected 10 features using the "Randomize Sampling". The second Sampler was fed from the NotSampled port of the first Sampler, and 10 more features were selected. Unfortunately both Samplers are selecting very similar patterns. Consistently, nearly every feature of the second sample is a neighbor of the first sample.

 

In our second attempt to get a more randomized pair of samples, rather than a repeated pattern, the first Sampler selects 20 randomized features. Those 20 are then fed to a second sampler to choose 10 from those 20. This approach generates what appears to be a more randomized sample of both primary and alternate survey hexagons.

 

Is there a better way to select a sample with alternates?

 

Why does the first approach seem to result in repeating patterns, rather than two different samples? We even tried setting the first Sampler to the first N features, and the second Sampler with the last N features - but this still resulted in the second set being neighbors of the first set.

I found a similar thing with the FeatureColorSertter - It seemed that while the colors were random, they were not random across different runs of the workspace.

 

One thing which might give you better results is to use a RandomNumberGenerator and sort them - you can then just sample the first ones. But it seems like you're approach of sampling 20 and then 10 achieves a similar result.


Reply