[GRASS-SVN] r41259 - grass/trunk/display/d.vect
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Mar 2 05:25:30 EST 2010
Author: mlennert
Date: 2010-03-02 05:25:29 -0500 (Tue, 02 Mar 2010)
New Revision: 41259
Modified:
grass/trunk/display/d.vect/local_proto.h
grass/trunk/display/d.vect/main.c
grass/trunk/display/d.vect/plot1.c
Log:
add sqrt_flag to make symbols proportionate to the square root of size_column (allows to make surface and not height of circles proportionate)
Modified: grass/trunk/display/d.vect/local_proto.h
===================================================================
--- grass/trunk/display/d.vect/local_proto.h 2010-03-02 02:47:00 UTC (rev 41258)
+++ grass/trunk/display/d.vect/local_proto.h 2010-03-02 10:25:29 UTC (rev 41259)
@@ -5,7 +5,7 @@
int close_vect(FILE *);
int plot1(struct Map_info *, int, int, struct cat_list *,
const struct color_rgb *, const struct color_rgb *, int, char *,
- double, char *, char *, int, int, int, char *, int, char *, double,
+ double, char *, int, char *, int, int, int, char *, int, char *, double,
int, char *);
int label(struct Map_info *, int, int, struct cat_list *, LATTR *, int);
int topo(struct Map_info *, int, int, LATTR *);
Modified: grass/trunk/display/d.vect/main.c
===================================================================
--- grass/trunk/display/d.vect/main.c 2010-03-02 02:47:00 UTC (rev 41258)
+++ grass/trunk/display/d.vect/main.c 2010-03-02 10:25:29 UTC (rev 41259)
@@ -98,7 +98,7 @@
struct Option *attrcol_opt, *maxreg_opt, *minreg_opt;
struct Option *width_opt, *wcolumn_opt, *wscale_opt;
struct Flag *id_flag, *table_acolors_flag, *cats_acolors_flag,
- *zcol_flag;
+ *zcol_flag, *sqrt_flag;
struct cat_list *Clist;
int *cats, ncat;
LATTR lattr;
@@ -357,6 +357,12 @@
zcol_flag->description = _("Colorize polygons according to z height");
zcol_flag->guisection = _("Colors");
+ sqrt_flag = G_define_flag();
+ sqrt_flag->key = 'r';
+ sqrt_flag->label = _("Use square root of the value of size_column");
+ sqrt_flag->description = _("Use this if you want to make the surface instead of the height of circles proportionate to size_column");
+ sqrt_flag->guisection = _("Symbols");
+
/* Check command line */
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -637,7 +643,7 @@
stat = plot1(&Map, type, area, Clist,
has_color ? &color : NULL,
has_fcolor ? &fcolor : NULL, chcat, icon_opt->answer,
- size, sizecolumn_opt->answer, rotcolumn_opt->answer,
+ size, sizecolumn_opt->answer, (int)sqrt_flag->answer, rotcolumn_opt->answer,
(int)id_flag->answer, table_acolors_flag->answer,
cats_acolors_flag->answer, rgbcol_opt->answer,
default_width, wcolumn_opt->answer, width_scale,
Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c 2010-03-02 02:47:00 UTC (rev 41258)
+++ grass/trunk/display/d.vect/plot1.c 2010-03-02 10:25:29 UTC (rev 41259)
@@ -1,6 +1,7 @@
/* plot1() - Level One vector reading */
#include <string.h>
+#include <math.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/vector.h>
@@ -41,7 +42,7 @@
int plot1(struct Map_info *Map, int type, int area, struct cat_list *Clist,
const struct color_rgb *color, const struct color_rgb *fcolor,
int chcat, char *symbol_name, double size, char *size_column,
- char *rot_column, int id_flag, int table_colors_flag,
+ int sqrt_flag, char *rot_column, int id_flag, int table_colors_flag,
int cats_color_flag, char *rgb_column, int default_width,
char *width_column, double width_scale, int z_color_flag,
char *style)
@@ -513,6 +514,9 @@
}
} /* end if nrec_size */
+ if (sqrt_flag)
+ var_size = sqrt(var_size);
+
/* dynamic symbol rotation */
if (nrec_rot) {
/* only first category */
More information about the grass-commit
mailing list