[R-sig-Geo] Supervised landscape classification according to NDVI time series

Robert Hijmans r.hijmans at gmail.com
Wed Jun 15 20:35:28 CEST 2011


> From what I understood, most landscape classification methods available 
> from GRASS (through R) do not account for the temporaI aspect of 
> spectrum. So for example, if you have a raster where each band 
> represents NDVI values at a given date, from March to September for 
> example, the classification will not consider that values are 
> time-dependant. I would like to use time series of NDVI values to 
> classify pixels in different type of crop, accordingly to the shape of 
> each time series (rapeseed will not present the same NDVI time serie as 
> would alfalfa or wheat). 
> I was wondering if someone could point me to a method that would allow 
> such classification using R ? I started looking at Functional Data 
> Analysis but I must admit that I'm a bit lost at the moment. 

If you want to ignore the problem that Matteo mentions (i.e. that temporal
signatures of a crop will vary over space), perhaps because you are working
with a relatively homogeneous (small & flat) geographic area, you can use a
number of (machine learning) algorithms. Chris mentioned CART, below is an
example using RandomForest, which is more powerful; indeed treating time as
'bands'. 

library(raster)

# monthly NDVI values (12 rasters)
r <- raster(ncol=20, nrow=20, extent(0,20,0,20))
s <- stack(lapply(1:12, function(x) setValues(r, runif(ncell(r)))))
layerNames(s) <- c('jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug',
'sep', 'oct', 'nov', 'dec')
s

#'ground truth' for 30 points, and 3 crops 
xy <- matrix(runif(60), ncol=2) * 20
crop <- factor(rep(1:3, each=10))
xyNDVI <- data.frame(crop, extract(s, xy))

library(randomForest)

# fit a model
m <- randomForest(crop~., data=xyNDVI)

# make a prediction
x <- predict(s, m)
plot(x)

Hth, Robert

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Supervised-landscape-classification-according-to-NDVI-time-series-tp6464837p6480065.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list