[GRASS-SVN] r68870 - grass/trunk/display/d.vect.thematic

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 6 13:49:58 PDT 2016


Author: neteler
Date: 2016-07-06 13:49:58 -0700 (Wed, 06 Jul 2016)
New Revision: 68870

Added:
   grass/trunk/display/d.vect.thematic/d_vect_thematic_leg.txt
Modified:
   grass/trunk/display/d.vect.thematic/d.vect.thematic.html
   grass/trunk/display/d.vect.thematic/d_vect_thematic.png
Log:
d.vect.thematic manual: example update (contributed by Vero Andreo)

Modified: grass/trunk/display/d.vect.thematic/d.vect.thematic.html
===================================================================
--- grass/trunk/display/d.vect.thematic/d.vect.thematic.html	2016-07-06 19:19:32 UTC (rev 68869)
+++ grass/trunk/display/d.vect.thematic/d.vect.thematic.html	2016-07-06 20:49:58 UTC (rev 68870)
@@ -80,31 +80,47 @@
 
 <h3>Thematic map with calculated class breaks</h3>
 
-<!-- TODO: find better example -->
+Example for the North Carolina sample dataset, colorizing basin polygons by
+average elevation:
 
-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
+# create watersheds from elevation map
+r.watershed elevation=elevation threshold=10000 basin=basins_10k
 
-# open the graphical display
+# 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 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>

Modified: grass/trunk/display/d.vect.thematic/d_vect_thematic.png
===================================================================
(Binary files differ)

Added: grass/trunk/display/d.vect.thematic/d_vect_thematic_leg.txt
===================================================================
--- grass/trunk/display/d.vect.thematic/d_vect_thematic_leg.txt	                        (rev 0)
+++ grass/trunk/display/d.vect.thematic/d_vect_thematic_leg.txt	2016-07-06 20:49:58 UTC (rev 68870)
@@ -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


Property changes on: grass/trunk/display/d.vect.thematic/d_vect_thematic_leg.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Author Date Id
Added: svn:eol-style
   + native



More information about the grass-commit mailing list