[GRASS-SVN] r53157 - grass/trunk/scripts/r.plane

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 10 16:19:06 PDT 2012


Author: hamish
Date: 2012-09-10 16:19:06 -0700 (Mon, 10 Sep 2012)
New Revision: 53157

Modified:
   grass/trunk/scripts/r.plane/r.plane.py
Log:
CELL,FCELL,DCELL instead of int,float,double for raster map type

Modified: grass/trunk/scripts/r.plane/r.plane.py
===================================================================
--- grass/trunk/scripts/r.plane/r.plane.py	2012-09-10 21:07:57 UTC (rev 53156)
+++ grass/trunk/scripts/r.plane/r.plane.py	2012-09-10 23:19:06 UTC (rev 53157)
@@ -8,7 +8,7 @@
 #               Modified to produce floating and double values maps
 #               Converted to Python by Glynn Clements
 # PURPOSE:	Creates a raster plane map from user specified inclination and azimuth
-# COPYRIGHT:	(C) 2004,2008 by the GRASS Development Team
+# COPYRIGHT:	(C) 2004-2012 by the GRASS Development Team
 #
 #		This program is free software under the GNU General Public
 #		License (>=v2). Read the file COPYING that comes with GRASS
@@ -60,9 +60,9 @@
 #%option
 #% key: type
 #% type: string 
-#% options: int,float,double
-#% description: Type of the raster map to be created
-#% required : yes
+#% options: CELL,FCELL,DCELL
+#% description: Type of raster map to be created
+#% answer: FCELL
 #%end
 
 import sys
@@ -101,14 +101,20 @@
     ky = cosaz * tandip
     kz = el - ea * sinaz * tandip - no * cosaz * tandip
 
-    if type == "int":
+    if type == "CELL":
 	round = "round"
+	dtype = "int"
+    elif type == "FCELL":
+	round = ""
+	dtype = "float"
     else:
 	round = ""
+	dtype = "double"
 
     grass.mapcalc("$name = $type($round(x() * $kx + y() * $ky + $kz))",
-		  name = name, type = type, round = round, kx = kx, ky = ky, kz = kz)
+		  name = name, type = dtype, round = round, kx = kx, ky = ky, kz = kz)
 
+    grass.run_command('r.support', map = name, history = '')
     grass.raster_history(name)
 
     grass.message(_("Done."))



More information about the grass-commit mailing list