# NOT RUN {
# Retrieve the samples for Mato Grosso
# select the bands for classification
samples_ndvi_evi <- sits_select(samples_mt_4bands, bands = c("EVI", "NDVI"))
# build the classification model
rfor_model <- sits_train(samples_ndvi_evi, sits_rfor(num_trees = 2000))
# select the bands "ndvi", "evi" provided by the SITS package
ndvi_file <- c(system.file("extdata/raster/mod13q1/sinop-ndvi-2014.tif",
package = "sits"
))
evi_file <- c(system.file("extdata/raster/mod13q1/sinop-evi-2014.tif",
package = "sits"
))
# select the timeline
data("timeline_2013_2014")
# build a data cube from files
sinop_2014 <- sits_cube(
type = "BRICK",
name = "sinop-2014",
timeline = timeline_2013_2014,
satellite = "TERRA",
sensor = "MODIS",
bands = c("ndvi", "evi"),
files = c(ndvi_file, evi_file)
)
# classify the raster image
sinop_probs <- sits_classify(sinop_2014,
rfor_model,
output_dir = tempdir(),
memsize = 4,
multicores = 2
)
plot(sinop_probs)
# }
Run the code above in your browser using DataLab