[GRASS-user] Fwd: [GRASS-dev] area() function in r.mapcalc

Markus Metz markus.metz.giswork at gmail.com
Fri Sep 15 12:52:16 PDT 2017


On Fri, Sep 15, 2017 at 5:10 PM, Moritz Lennert <
mlennert at club.worldonline.be> wrote:
>
>
>
>
> -------- Forwarded Message --------
> Subject: [GRASS-dev] area() function in r.mapcalc
> Date: Fri, 15 Sep 2017 16:32:29 +0200
> From: Moritz Lennert <mlennert at club.worldonline.be>
> To: Andy Wickert <andrewwickert at gmail.com>
> CC: grass-dev <grass-dev at lists.osgeo.org>
>
> Andy,
>
> As I just saw your contribution to the addons: r.cell.area [1],

r.cell.area uses a hard-coded sphere, ignoring the ellipsoid/sphere of the
current location, i.e. results are most probably wrong.

> please all note that 10 months ago MarkusM has implemented an area()
function in r.mapcalc [2]. This is currently only available in trunk, but
will thus be in GRASS GIS 7.4. This uses internal library functions

These internal library functions have been available since GRASS 4.0 (!).
All you need is
G_begin_cell_area_calculations()
followed by
G_area_of_cell_at_row()
for each row.

r.cell.area should use these GRASS functions, but r.cell.area will be
obsolete as soon as trunk with r.mapcalc's area() function is released as a
new minor GRASS 7 version.

Markus M

> which calculate area of the pixel taking into account the current
projection system.
>
> Moritz
>
>
> [1] https://trac.osgeo.org/grass/changeset/71487
> [2]
https://trac.osgeo.org/grass/changeset/69962/grass/trunk/raster/r.mapcalc
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170915/aa950823/attachment.html>


More information about the grass-user mailing list