When threshold=0, an error is generated by the fill_holes function. It should be nice, either:
to indicate in the manual that threshold must be strictly positive (one word to add in the description of the threshold parameter),
or to change the behaviour of the function, returning the same output as the original, input layer in case threshold is 0. The test is already done in the function (stopifnot(threshold > units::set_units(0, area_units, mode = "standard"))), it is just a minor change,
and, optionnaly, to emit a meaningful error message.
Thanks for the suggestion! I've allowed threshold to be zero in which case the function returns the input object unchanged. There's also a more informative error if threshold < 0.
When threshold=0, an error is generated by the fill_holes function. It should be nice, either:
to indicate in the manual that threshold must be strictly positive (one word to add in the description of the threshold parameter),
or to change the behaviour of the function, returning the same output as the original, input layer in case threshold is 0. The test is already done in the function (
stopifnot(threshold > units::set_units(0, area_units, mode = "standard"))
), it is just a minor change,and, optionnaly, to emit a meaningful error message.
Thanks,
Jean-Luc