# NOT RUN {
# Retrieve the set of samples for the Mato Grosso region (provided by EMBRAPA)
data(samples_mt_ndvi)
# Build a machine learning model based on the samples
svm_model <- sits_train(samples_mt_ndvi, sits_svm())
# read a raster file and put it into a vector
file <- system.file("extdata/raster/mod13q1/sinop-crop-ndvi.tif", package = "sits")
# define the timeline
data(timeline_modis_392)
# create a raster coverage file based on the information about the files
raster.tb <- sits_coverage(service = "RASTER", name = "Sinop-crop",
timeline = timeline_modis_392, bands = "ndvi", files = file)
# classify the raster file
raster_class.tb <- sits_classify_raster("raster-class", raster.tb,
ml_model = svm_model, memsize = 4, multicores = 1)
# plot the resulting classification
sits_plot_raster(raster_class.tb[1,], title = "SINOP class 2000-2001")
# }
Run the code above in your browser using DataLab