[R-sig-Geo] RasterBrick: Change resolution, keep the values

Rafael Wüest rafael.wueest at gmail.com
Wed Jul 9 19:00:50 CEST 2014


Hi Micheal,

I think you can use the raster::disaggregate function in this case, with 
method = ''

Check out ?disaggregate for more details.

HTH, Rafael


On 09.07.14 18:48, Michael Treglia wrote:
> Hi Michael,
>
> Looks like you're using the Raster package.  In that package, check out the
> resample() function (
> http://www.inside-r.org/packages/cran/raster/docs/resample) - looks like
> that does what you want.
>
> Make sure both layers are in the same projection - otherwise you can use
> projectRaster() instead.
>
> It looks like you haven't defined the projection for the second layer (as
> listed above, "coord. ref. : NA") - do that first (use projection() [
> http://www.inside-r.org/packages/cran/raster/docs/projection]).
> Alternatively, you can define the projection on import with the raster()
> command, using the "crs" argument.
>
> Hope that helps.
> Mike
>
>
>
>
> On Wed, Jul 9, 2014 at 11:35 AM, Michael Peichl <michael.peichl at ufz.de>
> wrote:
>
>> Dear all,
>>
>> I would like to change the resolution of the following RasterBrick to 100,
>> 100.
>>
>> class       : RasterBrick
>> dimensions  : 225, 175, 39375, 720  (nrow, ncol, ncell, nlayers)
>> resolution  : 4000, 4000  (x, y)
>> extent      : 4038000, 4738000, 5220000, 6120000  (xmin, xmax, ymin, ymax)
>> coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
>> data source : /home/usr/Documents/projects/...
>> names       : X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14,
>> X15, ...
>> z-value     : 1, 720 (min, max)
>> varname     : varname
>>
>> Thereby, the values of each Raster Cell on 4000,4000 resolution should be
>> allocated to 40x40 raster cellls, having the same value as the large cells.
>> I want to do this, because I want to use a raster on the more detailed
>> resolution as mask:
>>
>> class       : RasterLayer
>> dimensions  : 9000, 7000, 6.3e+07  (nrow, ncol, ncell)
>> resolution  : 100, 100  (x, y)
>> extent      : 4038000, 4738000, 5220000, 6120000  (xmin, xmax, ymin, ymax)
>> coord. ref. : NA
>> data source : in memory
>> names       : layer
>> values      : 12, 12  (min, max)
>>
>> Any recommendations?
>>
>> Thanks a lot!
>>
>> Sincerely
>> Michael
>>
>> --
>>
>> Dipl.-Vw. Michael Peichl
>> Ökonomie / Economics
>>
>> Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
>> Helmholtz Centre for Environmental Research GmbH - UFZ
>> Permoserstraße 15 / 04318 Leipzig / Germany
>> Telefon +49 341 235 1641 / Fax 0341 235 451641
>> michael.peichl at ufz.de / www.ufz.de
>>
>> Sitz der Gesellschaft: Leipzig
>> Registergericht: Amtsgericht Leipzig, Handelsregister Nr. B 4703
>> Vorsitzender des Aufsichtsrats: MinDirig Wilfried Kraus
>> Wissenschaftlicher Geschäftsführer: Prof. Dr. Georg Teutsch
>> Administrative Geschäftsführerin: Dr. Heike Graßmann
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
> 	[[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
>

-- 
Rafael Wüest
rafael.wueest at gmail.com
http://www.rowueest.net



More information about the R-sig-Geo mailing list