# NOT RUN {
{
require(raster)
# read raster data
r <- brick(system.file("extdata", "ndvi.tif", package="fieldRS"))
# spatial change labeling
or <- ccLabel(r, method="temporal", change.threshold=-50)$regions
# convert to polygons and plot (simple)
ef <- extractFields(or[10:30,10:30, drop=FALSE])
plot(ef)
# convert to polygons and plot (complex)
ef <- extractFields(or[10:30,1:30, drop=FALSE], method="complex")
plot(ef, border="red", add=TRUE)
# convert to polygons and plot (complex and smoothed)
ef <- extractFields(or[10:30,1:30, drop=FALSE], method="complex", smooth.x=TRUE)
plot(ef, border="blue", add=TRUE)
}
# }
Run the code above in your browser using DataLab