[R-sig-Geo] Fastest method to reclassify large raster.
Lionel Hertzog
s6lihert at uni-bonn.de
Fri Sep 13 09:06:21 CEST 2013
Dear Nevil Amos,
Maybe the function 'reclassify' in the raster package is what you are
looking for.
Yours,
Lionel
On 13/09/2013 08:36, nevil amos wrote:
> I have a large raster (4gb as a .asc file) with 197000 values, that I need
> to reclassify by values in an large lookup table, 197,000rowsx80reclass
> value columns.
>
> I have tried using sub in a loop to replace the values, however the process
> is taking hours, without even completing the first of the
> reclassifications.
>
> I would be grateful for any suggestions of processes that I can use to
> speed the reclass process ( I need files that can be read back into ARCGIS
> at the end of the process.
>
> My current script is
>
> library(raster)
> r<-raster("Raster.asc")
>
> COLS<-names(mydataOut[,5:88])
>
> for (i in COLS){
>
> subs(r,mydataOut,by="Value",which=i,filename=paste(i,".asc",sep=""))
> print(paste ("done", i))
> }
>
>
> Many thanks
>
> Nevil Amos
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list