Find the subset of a raster that best matches another raster

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Find the subset of a raster that best matches another raster

David Wang
Hello,


I have two raster objects of identical resolution but different sizes. And I need to find a subset of raster B that is most similar to raster A by for example a simple correlation measure. This subset of course needs to have the same size as A. Now I could loop through the dimensions of A and crop all possible subsets of size dim(A) and locate the one that has the highest correlation with A. However, I wonder if there are any more efficient algorithms to solve the problem.


library(raster)
b <- brick(system.file("external/rlogo.grd", package="raster"))
A <- crop(b[[1]], extent(b[[1]], 20, 60, 25, 75))

B <- b[[2]]

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo