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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 27 23:16:39 PDT 2014


Author: hamish
Date: 2014-05-27 23:16:39 -0700 (Tue, 27 May 2014)
New Revision: 60526

Modified:
   grass-addons/grass6/display/d.barb/points.c
Log:
respect peak= setting with vector input

Modified: grass-addons/grass6/display/d.barb/points.c
===================================================================
--- grass-addons/grass6/display/d.barb/points.c	2014-05-28 05:57:39 UTC (rev 60525)
+++ grass-addons/grass6/display/d.barb/points.c	2014-05-28 06:16:39 UTC (rev 60526)
@@ -59,6 +59,8 @@
     fill_arrays(&vMap, vlayer, dir_u_col, mag_v_col, is_component,
 		coord_x, coord_y, dirn, magn);
 
+    G_debug(3, "Arrays are filled.");
+
     if (aspect_type == TYPE_GRASS) {
 	for (i = 0; i < num_pts; i++) {
 	    //G_debug(5, "in=%.1f  out=%.1f", dirn[i], 90-dirn[i] < 0 ? 360+90-dirn[i] : 90-dirn[i]);
@@ -88,9 +90,10 @@
 	    G_warning(_("Maximum wind barb displayed is 150 knots"));
     }
 
-    peak = 1.;			// TODO: window width * 0.20
-    scale_fact = (peak) * scale;
+    scale_fact = 20. * scale / peak;
 
+    G_debug(3, "Ready to draw");
+
     for (i = 0; i < num_pts; i++) {
 	draw_barb(coord_x[i], coord_y[i], magn[i] * scale_fact, dirn[i],
 		  color, scale, style);
@@ -218,6 +221,8 @@
     Vect_rewind(Map);
     i = 0;
 
+    G_debug(3, "Select is done.");
+
     while (1) {
 	ltype = Vect_read_next_line(Map, Points, Cats);
 	switch (ltype) {



More information about the grass-commit mailing list