[GRASS-SVN] r67206 - in grass/trunk: lib/db/sqlp scripts/db.in.ogr scripts/v.db.join vector/v.lrs/v.lrs.create vector/v.lrs/v.lrs.segment

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 17 06:38:13 PST 2015


Author: neteler
Date: 2015-12-17 06:38:13 -0800 (Thu, 17 Dec 2015)
New Revision: 67206

Modified:
   grass/trunk/lib/db/sqlp/sql.html
   grass/trunk/scripts/db.in.ogr/db.in.ogr.html
   grass/trunk/scripts/v.db.join/v.db.join.html
   grass/trunk/vector/v.lrs/v.lrs.create/v.lrs.create.html
   grass/trunk/vector/v.lrs/v.lrs.segment/v.lrs.segment.html
Log:
SQL related manual entries: update some SQL examples to NC; fix db.select table calls

Modified: grass/trunk/lib/db/sqlp/sql.html
===================================================================
--- grass/trunk/lib/db/sqlp/sql.html	2015-12-17 13:33:30 UTC (rev 67205)
+++ grass/trunk/lib/db/sqlp/sql.html	2015-12-17 14:38:13 UTC (rev 67206)
@@ -85,16 +85,30 @@
 example):
 
 <div class="code"><pre>
-d.vect trapping_sites_points fcol=black icon=basic/diamond col=white size=13 \
-    where="valley <> 'LAMAR' OR (valley = 'LAMAR' AND description = 'extensive trapping')"
+g.region vector=schools_wake -p
+d.mon wx0
+d.vect roadsmajor
+
+# all schools
+d.vect schools_wake fcol=black icon=basic/diamond col=white size=13
+
+# numerical selection: show schools with capacity of above 1000 kids:
+d.vect schools_wake fcol=blue icon=basic/diamond col=white size=13 \
+    where="CAPACITYTO > 1000"
+
+# string selection: all schools outside of Raleigh 
+#   along with higher level schools in Raleigh
+d.vect schools_wake fcol=red icon=basic/diamond col=white size=13 \
+    where="ADDRCITY <> 'Raleigh' OR (ADDRCITY = 'Raleigh' AND GLEVEL = 'H')"
 </pre></div>
 
 <p>
-Select all attributes from table where <i>str1</i> column values are not 'No
-Name':
+Select all attributes from table where <i>CORECAPACI</i> column values are
+smaller than 200 (children):
 
 <div class="code"><pre>
-echo "SELECT * FROM archsites WHERE str1 <> 'No Name'" | db.select
+# must be run from the mapset which contains the table
+echo "SELECT * FROM schools_wake WHERE CORECAPACI < 200" | db.select input=-
 </pre></div>
 <p>
 
@@ -102,7 +116,7 @@
 Example of subquery expressions from a list (not supported for DBF driver):
 
 <div class="code"><pre>
-v.db.select mysites where="id IN ('P04', 'P05')"
+v.db.select schools_wake where="ADDRCITY IN ('Apex', 'Wendell')"
 </pre></div>
 
 <h3>Example of pattern matching</h3>
@@ -110,9 +124,10 @@
 <div class="code"><pre>
 # field contains string:
 #  for DBF driver:
-v.extract rivers out=rivers_noce where="DES LIKE 'NOCE'"
+v.extract schools_wake out=elementary_schools where="NAMELONG LIKE 'ELEM'"
 #  for SQLite driver:
-v.extract rivers out=rivers_noce where="DES LIKE '%NOCE%'"
+v.extract schools_wake out=rivers_noce where="DES LIKE '%NOCE%'"
+v.extract schools_wake out=elementary_schools where="NAMELONG LIKE '%ELEM%'"
 
 # match exactly number of characters (here: 2), does not work for DBF driver:
 v.db.select mysites where="id LIKE 'P__'"

Modified: grass/trunk/scripts/db.in.ogr/db.in.ogr.html
===================================================================
--- grass/trunk/scripts/db.in.ogr/db.in.ogr.html	2015-12-17 13:33:30 UTC (rev 67205)
+++ grass/trunk/scripts/db.in.ogr/db.in.ogr.html	2015-12-17 14:38:13 UTC (rev 67206)
@@ -17,7 +17,7 @@
 <div class="code"><pre>
 # NOTE: create koeppen_gridcode.csvt first for automated type recognition
 db.in.ogr input=koeppen_gridcode.csv output=koeppen_gridcode
-db.select koeppen_gridcode
+db.select table=koeppen_gridcode
 </pre></div>
 
 <h3>Import DBF table</h3>
@@ -43,7 +43,7 @@
 
 db.in.ogr input="PG:host=localhost dbname=ecad user=neteler" \
           db_table=ecad_verona_tmean output=ecad_verona_tmean
-db.select ecad_verona_tmean
+db.select table=ecad_verona_tmean
 db.describe -c ecad_verona_tmean
 </pre></div>
 
@@ -61,6 +61,7 @@
 <h2>SEE ALSO</h2>
 
 <em>
+<a href="db.select.html">db.select</a>,
 <a href="v.in.ogr.html">v.in.ogr</a>,
 <a href="v.in.db.html">v.in.db</a>
 </em>

Modified: grass/trunk/scripts/v.db.join/v.db.join.html
===================================================================
--- grass/trunk/scripts/v.db.join/v.db.join.html	2015-12-17 13:33:30 UTC (rev 67205)
+++ grass/trunk/scripts/v.db.join/v.db.join.html	2015-12-17 14:38:13 UTC (rev 67206)
@@ -73,8 +73,8 @@
 ...
 
 # look at legend
-db.select soils_legend
-db.select soils_legend | head -7
+db.select table=soils_legend
+db.select table=soils_legend | head -7
 id|shortname|longname
 0|no data|no data
 0|AaB|Alice fine sandy loam, 0 to 6
@@ -103,6 +103,7 @@
 <em>
 <a href="db.execute.html">db.execute</a>,
 <a href="db.in.ogr.html">db.in.ogr</a>,
+<a href="db.select.html">db.select</a>,
 <a href="v.db.update.html">v.db.update</a><br>
 <a href="sql.html">GRASS SQL interface</a>
 </em>

Modified: grass/trunk/vector/v.lrs/v.lrs.create/v.lrs.create.html
===================================================================
--- grass/trunk/vector/v.lrs/v.lrs.create/v.lrs.create.html	2015-12-17 13:33:30 UTC (rev 67205)
+++ grass/trunk/vector/v.lrs/v.lrs.create/v.lrs.create.html	2015-12-17 14:38:13 UTC (rev 67206)
@@ -133,7 +133,7 @@
 
 <div class="code"><pre>
 # show LRS table
-db.select route_lrs
+db.select table=route_lrs
 
 d.vect route_lrs col=blue width=2
 </pre></div>

Modified: grass/trunk/vector/v.lrs/v.lrs.segment/v.lrs.segment.html
===================================================================
--- grass/trunk/vector/v.lrs/v.lrs.segment/v.lrs.segment.html	2015-12-17 13:33:30 UTC (rev 67205)
+++ grass/trunk/vector/v.lrs/v.lrs.segment/v.lrs.segment.html	2015-12-17 14:38:13 UTC (rev 67206)
@@ -34,7 +34,7 @@
 d.vect route_lrs
 d.vect busstops disp=attr attr=cat size=10 bg=white lcol=blue yref=bottom
 d.vect busstops icon=basic/circle fcol=blue
-db.select route_lrs
+db.select table=route_lrs
 
 # show modified map
 d.vect route_lrs_new col=red



More information about the grass-commit mailing list