Takes up to size features, evenly spread over the collection — one every ⌈n / size⌉. Evenly rather than the first ones: the cost is the same, and a collection sorted by some column would otherwise show only one end of itself.
size
The layer's features, as converted.
The most features to keep — 1 000 by default.
The sample — the whole collection (a copy) when it holds no more than size.
sampleFeatures(Array.from({ length: 5 }, (_, i) => i), 2); // [0, 3] Copy
sampleFeatures(Array.from({ length: 5 }, (_, i) => i), 2); // [0, 3]
Takes up to
sizefeatures, evenly spread over the collection — one every ⌈n / size⌉. Evenly rather than the first ones: the cost is the same, and a collection sorted by some column would otherwise show only one end of itself.