I will be the devil’s advocate for a minute and illustrate an example where I have an eopatch containing extremely few valid
LULC pixels from which to sample (
n = 5).
Since I also perform an
ErosionTask on this
LULC layer before running
PointSamplingTask, I end up erasing all remaining valid pixels, meaning that the resulting
LULC_SAMPLED vector is empty and of shape
(0,1,1) even though
n_samples = 2000 . Likewise for
Considering this has implications for the preparation of
labels_training, labels_test, features_training, features_test , I think a warning or error should be raised, either at the
VectorToRaster step (which would be difficult because you may not decide to perform an
ErosionTask on it, in which case it remains valid), or at the
ErosionTask step, saying all valid pixels have eroded away, and potentially even skip the sampling on that eopatch altogether, so as to prevent problems later on.