Explorar o código

d.vect.thematic manual: NC example added (contributed by Vero Andreo); msg enhancement

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@65893 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=9) %!d(string=hai) anos
pai
achega
f8b932a55a

+ 40 - 7
display/d.vect.thematic/d.vect.thematic.html

@@ -34,21 +34,25 @@ write <em><a href="d.graph.html">d.graph</a></em> instructions for
 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 @@ display, the procedure is:
 <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,14 +69,43 @@ d.mon wx0
 
 # 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>
 

BIN=BIN
display/d.vect.thematic/d_vect_thematic.png


+ 1 - 1
display/d.vect.thematic/main.c

@@ -353,7 +353,7 @@ int main(int argc, char **argv)
     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);