Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining the size of grid cells in a raster

Tags:

r

raster

Is there a good method for determining the size of individual grid cells in a RasterLayer? I can access the resolution but I need the actual size in km^2. I've tried using the area() with my raster but it's not finding the window. I've also tried creating a SpatialGridDataFrame from my raster but have had no luck computing the area of each individual grid cell. Any help would be appreciated.

like image 678
Alex Avatar asked Jun 08 '16 18:06

Alex


People also ask

How do you determine the cell size of a raster?

Raster Resolution or "Cell Size"Cell size = Spatial Resolution: the dimension of the area covered on the ground and represented by a single pixel (e.g., 10m). A LandSat image has a resolution of 30 meters which means each pixel is about 90 feet by 90 feet square.

How can the units of the cell size be determined in Arcmap?

In order to get the cell size in meter, you need to change the projection of your raster from WGS84 to meter projection such as UTM or any other projections that is meter unit depending of the size of the study area.

How cell size affects the calculation of areas using raster data models?

Smaller cell sizes result in larger raster datasets to represent an entire surface; therefore, there is a need for greater storage space, which often results in longer processing time.

How do I find the pixel size in Arcmap?

Right-click the layer in the table of contents and click Properties. Click the Display tab. Check Display raster resolution in the table of contents. Click OK.


1 Answers

The cells size is the product of the x and y resolution prod(res(x)) if you have a planar coordinate reference system. Otherwise, if your crs is longitude/latitude, cell size will change with latitude, and you can indeed use the area function to get the size of each cell.

I take it that "it's not finding the window." refers to this error message Error in as.owin.default(w) : Can't interpret W as a window.

This is a name conflict with spatstat. So either do not load spatstat or call the raster function explicitly raster::area(x).

like image 164
Robert Hijmans Avatar answered Sep 30 '22 15:09

Robert Hijmans