[GRASS-SVN] r74168 - in grass/trunk: scripts/v.db.update vector/v.vect.stats

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 6 14:30:52 PST 2019


Author: neteler
Date: 2019-03-06 14:30:52 -0800 (Wed, 06 Mar 2019)
New Revision: 74168

Modified:
   grass/trunk/scripts/v.db.update/v.db.update.py
   grass/trunk/vector/v.vect.stats/main.c
   grass/trunk/vector/v.vect.stats/v.vect.stats.html
Log:
v.vect.stats: less cryptic error message; type casting hints added

Modified: grass/trunk/scripts/v.db.update/v.db.update.py
===================================================================
--- grass/trunk/scripts/v.db.update/v.db.update.py	2019-03-06 19:07:47 UTC (rev 74167)
+++ grass/trunk/scripts/v.db.update/v.db.update.py	2019-03-06 22:30:52 UTC (rev 74168)
@@ -20,6 +20,8 @@
 #% keyword: vector
 #% keyword: attribute table
 #% keyword: database
+#% keyword: attribute update
+#% keyword: type casting
 #%end
 #%option G_OPT_V_MAP
 #%end

Modified: grass/trunk/vector/v.vect.stats/main.c
===================================================================
--- grass/trunk/vector/v.vect.stats/main.c	2019-03-06 19:07:47 UTC (rev 74167)
+++ grass/trunk/vector/v.vect.stats/main.c	2019-03-06 22:30:52 UTC (rev 74168)
@@ -441,7 +441,7 @@
 	    db_column_Ctype(Pdriver, PFi->table, point_column_opt->answer);
 
 	if (ctype != DB_C_TYPE_INT && ctype != DB_C_TYPE_DOUBLE)
-	    G_fatal_error(_("column for points vector must be numeric"));
+	    G_fatal_error(_("points_column <%s> of points vector <%s> must be numeric"), point_column_opt->answer, PFi->table);
 
 	db_CatValArray_init(&cvarr);
 	nrec = db_select_CatValArray(Pdriver, PFi->table, PFi->key,

Modified: grass/trunk/vector/v.vect.stats/v.vect.stats.html
===================================================================
--- grass/trunk/vector/v.vect.stats/v.vect.stats.html	2019-03-06 19:07:47 UTC (rev 74167)
+++ grass/trunk/vector/v.vect.stats/v.vect.stats.html	2019-03-06 22:30:52 UTC (rev 74168)
@@ -60,9 +60,16 @@
 (no centroid attached or centroid without category) are ignored. 
 If no points are falling into a given area, the point count is set to 0
 (zero) and the statistics result to "null".
-<p>The columns <em>count_column</em> and <em>stats_column</em> are created if not
-existing. If they do already exist, the <em>count_column</em> must be of
+<p>
+The columns <em>count_column</em> and <em>stats_column</em> are created if not
+yet existing. If they do already exist, the <em>count_column</em> must be of
 type integer and the <em>stats_column</em> of type double precision.
+<p>
+In case that <em>v.vect.stats</em> complains about the <em>points_column</em>
+of the input points vector map not being numeric, the module
+<em>v.db.update</em> can be used to perform type casting, i.e. adding and
+populating an additional numeric column with the values type converted from
+string attributes to floating point numbers.
 
 <h2>EXAMPLES</h2>
 



More information about the grass-commit mailing list