[GRASS-SVN] r65872 - in grass/trunk: lib/db/sqlp vector/v.delaunay vector/v.mkgrid

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 10 06:49:54 PDT 2015


Author: neteler
Date: 2015-08-10 06:49:54 -0700 (Mon, 10 Aug 2015)
New Revision: 65872

Modified:
   grass/trunk/lib/db/sqlp/sql.html
   grass/trunk/vector/v.delaunay/v.delaunay.html
   grass/trunk/vector/v.mkgrid/main.c
Log:
sql manual: Example of conditions added

Modified: grass/trunk/lib/db/sqlp/sql.html
===================================================================
--- grass/trunk/lib/db/sqlp/sql.html	2015-08-10 13:13:38 UTC (rev 65871)
+++ grass/trunk/lib/db/sqlp/sql.html	2015-08-10 13:49:54 UTC (rev 65872)
@@ -187,6 +187,18 @@
 v.db.update vectormap column=column3 qcolumn="column1 || column2"
 </pre></div>
 
+<h3>Example of conditions</h3>
+
+Conditions (like if statements) are usually written as CASE statement in SQL:
+
+<div class="code"><pre>
+v.db.update vectormap column=species qcolumn="CASE WHEN col1 >= 12 THEN cat else NULL end"
+
+# a more complex example with nested conditions
+v.db.update vectormap column=species qcolumn="CASE WHEN col1 >= 1 THEN cat WHEN row = 13 then 0 ELSE NULL end"
+</pre></div>
+
+
 <h2>SEE ALSO</h2>
 
 <em>

Modified: grass/trunk/vector/v.delaunay/v.delaunay.html
===================================================================
--- grass/trunk/vector/v.delaunay/v.delaunay.html	2015-08-10 13:13:38 UTC (rev 65871)
+++ grass/trunk/vector/v.delaunay/v.delaunay.html	2015-08-10 13:49:54 UTC (rev 65872)
@@ -15,6 +15,13 @@
 <div class="code"><pre>
 g.region n=220750 s=219950 w=638300 e=639000 -p
 v.delaunay input=elev_lid792_randpts output=elev_lid792_randpts_delaunay
+
+
+  696  v.delaunay input=elev_lid792_bepts output=elev_lid792_bepts_tin 
+  697  v.colors elev_lid792_bepts_tin color=srtm_plus
+  698  d.erase 
+  699  d.vect elev_lid792_bepts_tin
+
 </pre></div>
 
 

Modified: grass/trunk/vector/v.mkgrid/main.c
===================================================================
--- grass/trunk/vector/v.mkgrid/main.c	2015-08-10 13:13:38 UTC (rev 65871)
+++ grass/trunk/vector/v.mkgrid/main.c	2015-08-10 13:49:54 UTC (rev 65872)
@@ -323,7 +323,9 @@
 	if (grid_info.north - grid_info.south < 3 * grid_info.rstep) {
 	    G_fatal_error(_("Please use a higher resolution or a larger region"));
 	}
-
+G_debug(0,"grid_info.num_vect_rows %d", grid_info.num_vect_rows);
+G_debug(0,"grid_info.num_rows %d", grid_info.num_rows);
+G_debug(0,"grid_info.num_vect_rows / 2.0 + 0.5: %f (int) %d", (grid_info.num_vect_rows / 2.0 + 0.5), (int)(grid_info.num_vect_rows / 2.0 + 0.5));
 	if ((int)(grid_info.num_vect_rows / 2.0 + 0.5) != grid_info.num_rows)
 	    G_message(_("The number of rows has been adjusted from %d to %d"),
 	              grid_info.num_rows, (int)(grid_info.num_vect_rows / 2.0 + 0.5));
@@ -366,7 +368,7 @@
 	    }
 	}
     }
-    else {
+    else { /* squares and rectangles */
 	if (grid_info.width != grid_info.height) {
 	    G_important_message(_("The rectangles will be asymmetrical."));
 	}



More information about the grass-commit mailing list