[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    Re: [R-sig-Geo] Aggregate raster
From:       "Dutrieux, Loic" <loic.dutrieux () wur ! nl>
Date:       2013-10-31 9:45:56
Message-ID: A83620D4CC4762448EFB789FD6E9BBB72A67967B () SCOMP0937 ! wurnet ! nl
[Download RAW message or body]

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@r-project.org [mailto:r-sig-geo-bounces@r-project.org] On \
                Behalf Of Acacia dealbata
Sent: Wednesday, October 30, 2013 18:04
To: r-sig-geo@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@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic