[GRASS-SVN] r45806 - grass-addons/display/d.barb

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 29 23:47:27 EDT 2011


Author: hamish
Date: 2011-03-29 20:47:27 -0700 (Tue, 29 Mar 2011)
New Revision: 45806

Modified:
   grass-addons/display/d.barb/grid.c
   grass-addons/display/d.barb/main.c
Log:
draw wind barbs with raster maps

Modified: grass-addons/display/d.barb/grid.c
===================================================================
--- grass-addons/display/d.barb/grid.c	2011-03-28 14:39:42 UTC (rev 45805)
+++ grass-addons/display/d.barb/grid.c	2011-03-30 03:47:27 UTC (rev 45806)
@@ -25,7 +25,7 @@
     double easting, northing;
 
     G_debug(0, "Doing Eulerian field ...");
-    G_warning("Not working yet -- use d.rast.arrow instead.");
+    G_warning("Not fully working yet -- use d.rast.arrow instead.");
 
     /* figure out arrow scaling */
     G_init_fp_range(&range);	/* really needed? */
@@ -33,7 +33,9 @@
 	G_fatal_error(_("Problem reading range file"));
     G_get_fp_range_min_max(&range, &mag_min, &mag_max);
 
-    scale *= 1.5 / fabs(mag_max);
+    if(style != TYPE_BARB) {
+	scale *= 1.5 / fabs(mag_max);
+    }
     G_debug(3, "scaling=%.2f  rast_max=%.2f", scale, mag_max);
 
     // howto figure for u,v maps where max_mag is not known until combined in render step?
@@ -139,10 +141,11 @@
 	    if (aspect_f >= 0.0 && aspect_f <= 360.0) {
 		if (mag_v_map) {
 		    if (aspect_type == TYPE_GRASS)
-			arrow_mag(easting, northing, aspect_f, length, style);
+			draw_barb(easting, northing, length, aspect_f, 
+				  color, scale, style);
 		    else
-			arrow_mag(easting, northing, 90 - aspect_f, length,
-				  style);
+			draw_barb(easting, northing, length, 90 - aspect_f, 
+				  color, scale, style);
 		}
 		else {
 		    if (aspect_type == TYPE_GRASS) ;	//todo   arrow_360(aspect_f);

Modified: grass-addons/display/d.barb/main.c
===================================================================
--- grass-addons/display/d.barb/main.c	2011-03-28 14:39:42 UTC (rev 45805)
+++ grass-addons/display/d.barb/main.c	2011-03-30 03:47:27 UTC (rev 45806)
@@ -94,7 +94,7 @@
     skip_opt->key = "skip";
     skip_opt->type = TYPE_INTEGER;
     skip_opt->required = NO;
-    skip_opt->answer = "100";
+    skip_opt->answer = "10";
     skip_opt->description = _("Draw arrow every Nth grid cell");
     skip_opt->guisection = _("Raster");
 



More information about the grass-commit mailing list