[R-sig-Geo] Aggregate raster
Dutrieux, Loic
loic.dutrieux at wur.nl
Thu Oct 31 10:45:56 CET 2013
Hi Noelia,
The fact= arguments needs to be an integer.
You probably need to reproject anyway, right? So what about aggregating to something close to your 0.16 degree and then reproject to exactly 0.16667 degree resolution (using nearest neighbour resampling). Take a look at the new gdalUtils package (https://r-forge.r-project.org/R/?group_id=1695) for the reprojecting step; probably the gdalwarp function.
# Aggregate
rnew<-aggregate(rprevious, fact=6, fun=modal)
# Reproject using gdalwarp
...
Best regards,
--
Loïc Dutrieux
PhD candidate
Laboratory of Geo-Information sciences and remote sensing
Wageningen University, The Netherlands
-----Original Message-----
From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Acacia dealbata
Sent: Wednesday, October 30, 2013 18:04
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] Aggregate raster
Hi community!
I have a raster of Global Land Cover with a resolution of 1 km (http://glcf.umd.edu/).
I want to change its resolution to be similar to that of the rest of the rasters I am using for my project (0.166667 degrees).
Besides, I want to recalculate the value for each new cell. In the original raster, there are 12 categories of land use. In my new raster, I want the new cells to have the value more often repeated among those of the original cells.
I have tried with this:
rnew<-aggregate(rprevious, factor=(1/0.1666667), fun=modal)
But it is not working. Any help? Seems correct?
Thank you!
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Aggregate-raster-tp7584991.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
_______________________________________________
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