[GRASS-dev] How obtaining the area of a cell

Glynn Clements glynn at gclements.plus.com
Fri Apr 11 14:48:38 EDT 2008


roberto caselli wrote:

> Sorry for this silly question but I have a doubt now: Can an elevation
> raster map have cells with different areas? I though that all cells in
> a map had the same sizes...

All cells have the same dimensions measured in the location's
coordinate system.

However, for lat/lon data, each cell will have fixed dimensions in
degrees, but it's physical area will vary with latitude.

This is why G_area_of_cell_at_row() takes the row as an argument.

For projected data, it returns a constant value based upon the
region's resolution and the location's units (metres, feet, etc). For
lat-lon data, the conversion takes into account the row's latitude and
the location's ellipsoid.

Also, note that G_begin_cell_area_calculations() must be called to
initialise the conversion parameters prior to calling
G_area_of_cell_at_row().

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list