Great! Exactly what I needed!

Would it be possible to also include some mask into the rasterEngine
function? My image is rotated for about 45° which means that a significant
part of my rasterstack consits out of NA values. I suppose that skipping
these cells would speed up things.

Ruben


2014-03-14 18:38 GMT+01:00 Jonathan Greenberg <jgrn@illinois.edu>:

> Ruben:
>
> Give rasterEngine, within the spatial.tools package a whirl.  Here's
> the tutorial for it (some things are bit out of date, but this does
> cover the focal analyses):
>
>
> http://publish.illinois.edu/jgrn/software-and-datasets/rasterengine-tutorial/
>
> Note there are examples of focal windows towards the end of the
> tutorial.  If you use a parallel engine (e.g. sfQuickInit() ) it will
> run your process in parallel -- I've found a significant speedup using
> focal windows in parallel mode.
>
> --j
>
> On Fri, Mar 14, 2014 at 10:10 AM, Ruben Van De Kerchove
> <ruben.vandekerchove@gmail.com> wrote:
> > Hi,
> >
> > I have rasterstack consisting out of 252 rasters (hyperspectral image)
> for
> > which I want to calculate the mean distance to the centroid in a
> 3*3(*252)
> > moving window. As the focal function (from the raster package) only works
> > for rasters, I am currently using the getValuesBlock function (in a
> loop),
> > but this seems rather slow. Therefore, I was wondering, if there is a
> more
> > efficient way to tackle this problem.
> >
> > Best,
> > Ruben
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>
> --
> Jonathan A. Greenberg, PhD
> Assistant Professor
> Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
> Department of Geography and Geographic Information Science
> University of Illinois at Urbana-Champaign
> 259 Computing Applications Building, MC-150
> 605 East Springfield Avenue
> Champaign, IL  61820-6371
> Phone: 217-300-1924
> http://www.geog.illinois.edu/~jgrn/
> AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>

	[[alternative HTML version deleted]]

