Your idea about the "rasters" is not very clearly stated, but you might have a look at the paper by Borcard and Legendre (1994) and their later workstheir later works on spatial eigenvector-based analyses to see if one of the approaches will fit to your problem.
Borcard, D., Legendre, P., (1994) Environmental control and spatial structure in ecological communities: an example using oribatid mites (Acari, Oribatei). Environmental and Ecological Statistics 1, 37–61.Borcard, D., Legendre, P., (1994) Environmental control and spatial structure in ecological communities: an example using oribatid mites (Acari, Oribatei). Environmental and Ecological Statistics 1, 37–61.