View source: R/SOptim_RasterOutputs.R
getTrainRasterSegments | R Documentation |
An utility function used to create a raster dataset containing train segments for a given segmentation solution and a train raster.
getTrainRasterSegments(
trainData,
rstSegm,
filename = NULL,
useThresh = TRUE,
thresh = 0.5,
na.rm = TRUE,
dup.rm = TRUE,
minImgSegm = 30,
ignore = FALSE,
verbose = TRUE,
...
)
trainData |
Input train data. The input can be a |
rstSegm |
A path or a |
filename |
A filename/path used to write the output raster (default: NULL) |
useThresh |
Use threshold to filter training data for multi-class? (default: TRUE; not used for points). |
thresh |
A threshold value defining the minimum proportion of the segment ]0, 1] that
must be covered by a certain class to be considered as a training case. This threshold will
only apply if |
na.rm |
Remove NA's? (default: TRUE). Only used if |
dup.rm |
Remove duplicate values? (default: TRUE; see details). Only used if |
minImgSegm |
Minimum number of image segments/objects necessary to generate train data. |
ignore |
If set to TRUE then train data may contain one single class. This is useful in cases where sample units contain only positive or negative train cases. Also applies if the threshold value is employed. In this case if no positive cases are generated then negatives will be returned (default: FALSE). |
verbose |
Print comments with function progress? (default: TRUE) |
... |
Additional options passed to |
A SpatRaster object with train segments.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.