[GRASS-SVN] r65863 - grass/branches/releasebranch_7_0/scripts/v.db.join

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 8 07:38:17 PDT 2015

Author: neteler
Date: 2015-08-08 07:38:16 -0700 (Sat, 08 Aug 2015)
New Revision: 65863

v.db.join manual: NC example added for geology map

Modified: grass/branches/releasebranch_7_0/scripts/v.db.join/v.db.join.html
--- grass/branches/releasebranch_7_0/scripts/v.db.join/v.db.join.html	2015-08-08 14:37:45 UTC (rev 65862)
+++ grass/branches/releasebranch_7_0/scripts/v.db.join/v.db.join.html	2015-08-08 14:38:16 UTC (rev 65863)
@@ -12,8 +12,43 @@
 imported with <em>db.in.ogr</em>.
 <p>The vector map-database connection(s) can be verified with <em>v.db.connect</em>.
+Exercise to join North Carolina geological classes from a CSV table to
+the "geology" map of the North Carolina sample dataset (requires download
+of legend CSV file <a href="http://www.grassbook.org/wp-content/uploads/ncexternal/nc_geology.csv">nc_geology.csv</a>
+from <a href="http://www.grassbook.org/wp-content/uploads/ncexternal/index.html">External data for NC sample dataset</a>):
+<div class="code"><pre>
+# check original map attributes
+v.db.select geology column=GEO_NAME,SHAPE_area
+# import of CSV table
+db.in.ogr input=nc_geology.csv output=nc_geology
+# work on copy of geology map in current mapset
+g.copy vector=geology,mygeology
+# check column names of vector map attributes
+v.info -c mygeology
+# check column names of legend table
+db.describe -c nc_geology
+# join table using key columns (map: "GEO_NAME"; table: "geol_id")
+v.db.join map=mygeology column=GEO_NAME other_table=nc_geology other_column=geol_id
+# verify result (here abbreviated)
+v.db.select mygeology | head -3
+1|963738.75|4083.97998|2|1|Zml|963738.608571|4083.979839|Zml|Metagraywacke|Interlayered with metaconglomerate, ...
+2|22189124|26628.261719|3|2|Zmf|22189123.2296|26628.261112|Zmf|Metafelsite|Light-colored porphyritic extrusive rock
+<h3>Soil map table join</h3>
 Joining the soil type explanations from table <em>soils_legend</em>
 into the Spearfish soils map (<a href="http://www.grassbook.org/examples_menu.php">download legend)</a>:

More information about the grass-commit mailing list