[GRASS-SVN] r65893 - grass/branches/releasebranch_7_0/display/d.vect.thematic

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 11 14:07:09 PDT 2015


Author: neteler
Date: 2015-08-11 14:07:09 -0700 (Tue, 11 Aug 2015)
New Revision: 65893

Added:
   grass/branches/releasebranch_7_0/display/d.vect.thematic/d_vect_thematic.png
Modified:
   grass/branches/releasebranch_7_0/display/d.vect.thematic/
   grass/branches/releasebranch_7_0/display/d.vect.thematic/d.vect.thematic.html
   grass/branches/releasebranch_7_0/display/d.vect.thematic/main.c
Log:
d.vect.thematic manual: NC example added (contributed by Vero Andreo); msg enhancement


Property changes on: grass/branches/releasebranch_7_0/display/d.vect.thematic
___________________________________________________________________
Modified: svn:ignore
   - OBJ.*

   + OBJ.*
*.tmp.html


Modified: grass/branches/releasebranch_7_0/display/d.vect.thematic/d.vect.thematic.html
===================================================================
--- grass/branches/releasebranch_7_0/display/d.vect.thematic/d.vect.thematic.html	2015-08-11 21:06:03 UTC (rev 65892)
+++ grass/branches/releasebranch_7_0/display/d.vect.thematic/d.vect.thematic.html	2015-08-11 21:07:09 UTC (rev 65893)
@@ -34,21 +34,25 @@
 painting a legend into that file.
 
 
-<h2>EXAMPLE</h2>
+<h2>EXAMPLES</h2>
 
+<h3>Thematic map with classes</h3>
+
 <div class="code"><pre>
 d.vect.thematic -l map=communes3 column=pop \
   breaks=111393.250000,222785.500000,334177.750000 \
-  colors=255:0:0,0:255:0,0:0:255,0,0,0
+  colors="255:0:0,0:255:0,0:0:255,0,0,0"
 </pre></div>
 
+<h3>Thematic map with calculated class breaks</h3>
+
 The following example uses a calculated attribute (<tt>density = 
 pop/area</tt>) and the standard deviation algorithm to calculate class 
 breaks for 5 classes:
 
 <div class="code"><pre>
 d.vect.thematic -l map=communes2 column=pop/area algorithm=std \
-  nbclasses=5 colors=0:0:255,50:100:255,255:100:50,255:0:0,156:0:0
+  nbclasses=5 colors="0:0:255,50:100:255,255:100:50,255:0:0,156:0:0"
 </pre></div>
 
 To actually draw the legend for the polygons in the graphical
@@ -57,7 +61,7 @@
 <div class="code"><pre>
 # first save legend instructions to a file	
 d.vect.thematic -n map=communes2 column=pop/area algorithm=std \
-  nbclasses=5 colors=0:0:255,50:100:255,255:100:50,255:0:0,156:0:0 \
+  nbclasses=5 colors="0:0:255,50:100:255,255:100:50,255:0:0,156:0:0" \
   legendfile=legend_pop_dens  
 
 # open a monitor
@@ -65,15 +69,44 @@
 
 # draw the map
 d.vect.thematic map=communes2 column=pop/area algorithm=std \
-  nbclasses=5 colors=0:0:255,50:100:255,255:100:50,255:0:0,156:0:0
+  nbclasses=5 colors="0:0:255,50:100:255,255:100:50,255:0:0,156:0:0"
 
 # draw the legend
 d.graph input=legend_pop_dens
 </pre></div>
 
-If you are not pleased with the legend, you can edit the legend file
-as you wish and run the process again. 
+In order to further enhance this legend, edit the legend file accordingly
+and rerun the process.
 
+<h3>Thematic map with calculated class breaks</h3>
+
+<!-- TODO: find better example -->
+
+Example for the North Carolina sample dataset, colorizing polygons by
+area size:
+
+<div class="code"><pre>
+# first save legend instructions to a file
+d.vect.thematic -n map=geology column=SHAPE_area algorithm=int nclasses=6 \
+ colors=215:48:39,252:141:89,254:224:139,217:239:139,145:207:96,26:152:80 \
+ legendfile=geology.leg
+
+# open the graphical display
+d.mon wx0
+# draw outline of polygons
+d.vect map=geology type=boundary
+# draw color fill
+d.vect.thematic map=geology column=SHAPE_area algorithm=int nclasses=6 \
+ colors="215:48:39,252:141:89,254:224:139,217:239:139,145:207:96,26:152:80" \
+# draw legend
+d.graph input=geology.leg
+</pre></div>
+
+<center>
+<img src="d_vect_thematic.png" alt="d_vect_thematic example" border=1><br>
+Thematic map of area sizes
+</center>
+
 <h2>SEE ALSO</h2>
 
 <em>

Copied: grass/branches/releasebranch_7_0/display/d.vect.thematic/d_vect_thematic.png (from rev 65892, grass/trunk/display/d.vect.thematic/d_vect_thematic.png)
===================================================================
(Binary files differ)

Modified: grass/branches/releasebranch_7_0/display/d.vect.thematic/main.c
===================================================================
--- grass/branches/releasebranch_7_0/display/d.vect.thematic/main.c	2015-08-11 21:06:03 UTC (rev 65892)
+++ grass/branches/releasebranch_7_0/display/d.vect.thematic/main.c	2015-08-11 21:07:09 UTC (rev 65893)
@@ -353,7 +353,7 @@
     if (colors_opt->answers != NULL) {
 	for (i = 0; i < nclass; i++) {
 	    if (colors_opt->answers[i] == NULL)
-		G_fatal_error(_("Not enough colors or error in color specifications.\nNeed %i colors."),
+		G_fatal_error(_("Not enough colors or error in color specifications.\nNeed %i entries for 'colors' parameter"),
 			      nclass);
 
 	    ret = G_str_to_color(colors_opt->answers[i], &r, &g, &b);



More information about the grass-commit mailing list