Add variance to the number of geometries/components in multipoint/multilinestring/multipolygon generator #1173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR closes #1161
This PR adds normal distribution to the number of points, linestrings and polygons in the geometry generators. The generator API hasn't change, the parameters structs are now strongly typed with two different types:
multipoint_normal_distribution_generator_parameter
andmultipoint_fixed_generator_parameter
. The latter inherits the former because fixed output is a special case of normal distribution withstddev==0
.In the fixed generator case, the generator behave as it is today - every pair has exactly the same number of geometry per pair.
In the normal distribution generator case, each of the count parameter is treated as the mean of the distribution and sampled with a normal distribution, an additional
stddev
parameter is provided to control the variance. (Note that the count of geometry is always greater or equal to 1).In this current draft PR, by setting
num_point_per_multipoint=30, stddev=5
, I can generate amultipoint_array
with the number of point per multipoint with the following distribution:stddev=0
stddev=20
Checklist