Description Usage Arguments Value Author(s) References Examples
Analysis of the spatial consistency (agreement) of two Raster-class
objects with dimensions
x (lon), y (lat), z (time). The analysis is performed layer by layer. At a given z, an entire layer is extracted in
in the two rasters and the two layers are compared using a set of statistics. This results in a time serie for
each computed statistic, depicting the temporal profile (seasonality) of the spatial coherence (agreement) between the two datasets.
1 | compare_raster_space(x,y,lc,stats)
|
x |
A |
y |
Another |
lc |
An optional |
stats |
A character
|
an array
of statistics with 1st dimension corresponding to layers in input rasters, 2nd dimension to
stats
and optional 3rd dimension to classes defined by lc
Antoine Stevens
Ji, L., and Gallo, K. (2006). An Agreement Coefficient for Image Comparison. Photogrammetric Engineering & Remote Sensing 72, 823-833. Meroni, M., Atzberger, C., Vancutsem, C., Gobron, N., Baret, F., Lacaze, R., Eerens, H., and Leo, O. (2013). Evaluation of Agreement Between Space Remote Sensing SPOT-VEGETATION fAPAR Time Series. IEEE Transactions on Geoscience and Remote Sensing 51, 1951-1962. Meroni M., Fasbender D., Balaghi et al. (2015). Testing VGT data continuity between SPOT and PROBA-V missions for operational yield forecasting in North African countries. JRC Technical Report, 28 p.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## Not run:
# Let's compare VGT and PROBA-V instruments during their overlaping period
# (October 2013 - March 2014)
# Don't forget to provide in copernicus_options() your user and password details
# for COPERNICUS data portal before running this
# e.g. : copernicus_options(user = "Smith", password = "hello")
# First, get data for NDVI_1km_V1
fn_SPOT <- download_copernicus(product = 'NDVI_1km_V1', begin = '2013-10-01', end = '2014-03-31',
tileH = 19, tileV = 4)
# and NDVI_1km_V2 ...
fn_PROBA <- download_copernicus(product = 'NDVI_1km_V2', begin = '2013-10-01', end = '2014-03-31',
tileH = 19, tileV = 4)
# Extract NDVI, export to tif
f_SPOT <-extract_copernicus(fn_SPOT,job = "product_comparison",layers = 2)
f_PROBA <-extract_copernicus(fn_PROBA,job = "product_comparison",layers = 1)
# Convert to rasterBrick
f_SPOT <- sub('\\.h5','_NDVI.tif',f_SPOT)
f_PROBA <- sub('\\.h5','_NDVI.tif',f_PROBA)
SPOT <- writeRaster(stack(f_SPOT),filename = rasterTmpFile())
PROBA <- writeRaster(stack(f_PROBA),filename = rasterTmpFile())
# Compare their spatial consistency
# by land cover class
# Create a fake LC map
lc <- raster(SPOT)
values(lc) <- as.numeric(cut(1:ncell(lc), 3))
cs <- compare_raster_space(SPOT,PROBA,lc)
str(cs)
# plot the three classes
# get correlation coeff
r <- cs[,"cor",]
# get acquisition dates
d <- scan_file_copernicus(names(SPOT))$Date
plot(d,r[,1],type = "l",xlab = "", ylab = "Correlation coefficient",ylim=c(0,1))
lines(d,r[,2],col = "red")
lines(d,r[,3],col = "blue")
legend("bottomright",lty = 1, legend = paste0("class ", 1:3), col = c("black","red","blue"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.