On Tue, May 24, 2011 at 4:32 PM, Carsten Neumann <carstennh@aol.com> wrote:

>  Am 24.05.2011 10:17, schrieb Luca Morandini:
>
>  Folks,
>>
>> I have played a bit with the R "raster" package, and found it has an
>> impressive list of features; however, its performance seems to be less than
>> optimal when confronted with sizeable rasters (say, a 250MB GeoTIFF): a
>> focal statistics that took less than a minute in GRASS, took 7 hours or so
>> in R.
>>
>> Is there anything I could do to speed it up (I already tried readAll
>> before invoking the focal statistic function) ?
>>
>> Regards,
>>
>> Luca Morandini
>> http://www.lucamorandini.it
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
> Dear all,
>
> I discovered such performance problems concerning computation time, too.
> Using the function rasterToPolygons() for a 30Mb, 1Byte integer GeoTiff took
> 10 times longer than using a common GIS software. Why is that the case? I
> had to change to other R implementet GIS functionallity like in the package
> RSAGA. When posible reading data into memory will also accelerate processing
> time.
>

As far as I know, the raster package is written mainly in R, and SAGA and
other GIS programs like GRASS and QGIS are written in C. C is a compile
language, wherefore the code has already translated into machine readable
code, where i the case of R, the code gets translated line by line. And when
there is a loop, the code is translated for each iteration.

In the new release of R, there is a compiler included - I have no idee how
much improvement one could expect, but it could be worth a try.

Cheers,

Rainer



>
> Best regards
>
> Carsten
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

	[[alternative HTML version deleted]]

