[GRASS-SVN] r71492 - grass-addons/grass7/raster/r.cell.area

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 15 07:23:11 PDT 2017


Author: awickert
Date: 2017-09-15 07:23:11 -0700 (Fri, 15 Sep 2017)
New Revision: 71492

Modified:
   grass-addons/grass7/raster/r.cell.area/r.cell.area.py
Log:
statistics cat + np.pi per Neteler


Modified: grass-addons/grass7/raster/r.cell.area/r.cell.area.py
===================================================================
--- grass-addons/grass7/raster/r.cell.area/r.cell.area.py	2017-09-15 07:38:36 UTC (rev 71491)
+++ grass-addons/grass7/raster/r.cell.area/r.cell.area.py	2017-09-15 14:23:11 UTC (rev 71492)
@@ -20,7 +20,7 @@
 
 #%module
 #% description: Calculate cell sizes within the computational region
-#% keyword: raster
+#% keyword: raster, statistics
 #%end
 
 #%option G_OPT_R_OUTPUT
@@ -78,10 +78,10 @@
     elif projinfo['units'] == 'degrees':
         if units == 'm2':
             grass.mapcalc(output+' = ( 111195. * nsres() ) * \
-                          ( ewres() * (3.14159/180.) * 6371000. * cos(y()) )')
+                          ( ewres() * '+str(np.pi/180.)+' * 6371000. * cos(y()) )')
         elif units == 'km2':
             grass.mapcalc(output+' = ( 111.195 * nsres() ) * \
-                          ( ewres() * (3.14159/180.) * 6371. * cos(y()) )')
+                          ( ewres() * '+str(np.pi/180.)+' * 6371. * cos(y()) )')
     else:
         print 'Units: ', + projinfo['units'] + ' not currently supported'
     



More information about the grass-commit mailing list