[R-sig-Geo] Calculate area of raster cells

Roger Bivand Roger.Bivand at nhh.no
Wed Apr 28 13:16:14 CEST 2010


On Wed, 28 Apr 2010, Paul Hiemstra wrote:

> Tim Erbrecht wrote:
>> 
>> Dear all,
>>
>> 
>> having data in a SpatialGridDataFrame with geographic coordinates, is there 
>> a simple method to calculate the spatial area for each cell? I wasn't able 
>> to find anything in the list archives ...
>>
>> 
>> Thanks and best regards
>> 
>> Tim
>> 
>> ------------------------------------------------------------------------
>> 
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>> 
> with the meuse dataset:
>
> library(sp)
> data(meuse.grid)
> gridded(meuse.grid) = ~x+y
> fullgrid(meuse.grid) = TRUE
> bla = gridparameters(meuse.grid)
> area = bla$cellsize[1] * bla$cellsize[2]
> area

These are projected, not geographical coordinates, unfortunately. The case 
for calculating areas on an ellipsoid is much harder, I'm afraid.

Roger

>
> cheers,
> Paul
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list