Explorar o código

d.vect.thematic manual: example update (contributed by Vero Andreo)

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

+ 32 - 16
display/d.vect.thematic/d.vect.thematic.html

@@ -80,31 +80,47 @@ 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:
+Example for the North Carolina sample dataset, colorizing basin polygons by
+average elevation:
 
 <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
+# create watersheds from elevation map
+r.watershed elevation=elevation threshold=10000 basin=basins_10k
+
+# convert raster to vector
+r.to.vect input=basins_10k output=basins_10k type=area column=basin_num
+
+# upload raster statistics to each polygon in vector map
+v.rast.stats map=basins_10k raster=elevation column_prefix=elev_
+
+# save legend instructions to a file
+d.vect.thematic -n map=basins_10k column=elev_average algorithm=int \
+  nclasses=5 colors=228:26:28,55:126:184,77:175:74,152:78:163,255:127:0 \
+  legendfile=d_vect_thematic_leg.txt
 
-# open the graphical display
+# open a graphical display
 d.mon wx0
+
 # draw outline of polygons
-d.vect map=geology type=boundary
+d.vect map=basins_10k 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
+d.vect.thematic map=basins_10k column=elev_average algorithm=int \
+  nclasses=5 colors=228:26:28,55:126:184,77:175:74,152:78:163,255:127:0
+
+# set a different font (list fonts with: d.font -l)
+export GRASS_FONT="sans"
+
+# and finally draw legend, but edit the legend file first (for example:
+# set size to 20, remove feature counts and most decimal digits)
+d.graph input=d_vect_thematic_leg.txt
 </pre></div>
 
 <center>
-<img src="d_vect_thematic.png" alt="d_vect_thematic example" border=1><br>
-Thematic map of area sizes
+<a href="d_vect_thematic.png">
+<img src="d_vect_thematic.png" alt="d_vect_thematic example" border=1 width="600"></a>
+<br>
+<i>Thematic map of area sizes</i>
 </center>
 
 <h2>SEE ALSO</h2>

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


+ 16 - 0
display/d.vect.thematic/d_vect_thematic_leg.txt

@@ -0,0 +1,16 @@
+size 20
+symbol basic/box 25 5 10 black 228:26:28
+move 8 9 
+text 64.9 - 80.4
+symbol basic/box 25 5 16 black 55:126:184
+move 8 15
+text 80.4 - 95.9
+symbol basic/box 25 5 22 black 77:175:74
+move 8 21
+text 95.9 - 111.4
+symbol basic/box 25 5 28 black 152:78:163
+move 8 27
+text 111.4 - 126.9
+symbol basic/box 25 5 34 black 255:127:0
+move 8 33
+text 126.9 - 142.5