Skip to content
Prev 11780 / 29559 Next

Performance of raster package

Thanks for pointing this out. Some functions in 'raster' are indeed
slower/faster than others. Some seem to be reasonably quick. The focal*
functions are slow, and indeed, as Rainer alludes to, good candidates for a
C-implementation of at least the basic cases (e.g. fun=mean). Although I
recently made them a bit more efficient, so it would be good to know which
version of raster you are using. When reporting speed problems, please also
report the number of rows/columns of the object and the exact function
(focal, focalFilter, focalNA?) used. In the case of the focal functions it
could matter a lot which "fun" you used to compute the focal values; as that
might be what further slows things down. rasterToPolygons is also slow; in
part because I did not pay much attention to it. I just made it a bit
quicker (almost twice as fast), but much more could probably be done. That
is, speed is not only a function of R vs. C code, but also of the quality of
the algorithm used. The value of the 'raster' package over "GIS" software is
obviously not speed of execution, but the ease (speed) of use and the
benefit of the integration with everything else in R. 

Robert
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Performance-of-raster-package-tp6397653p6399759.html
Sent from the R-sig-geo mailing list archive at Nabble.com.