[GRASS-SVN] r74169 - in grass/branches/releasebranch_7_6: scripts/v.db.update vector/v.vect.stats

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 6 14:31:36 PST 2019


Author: neteler
Date: 2019-03-06 14:31:36 -0800 (Wed, 06 Mar 2019)
New Revision: 74169

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

Modified: grass/branches/releasebranch_7_6/scripts/v.db.update/v.db.update.py
===================================================================
--- grass/branches/releasebranch_7_6/scripts/v.db.update/v.db.update.py	2019-03-06 22:30:52 UTC (rev 74168)
+++ grass/branches/releasebranch_7_6/scripts/v.db.update/v.db.update.py	2019-03-06 22:31:36 UTC (rev 74169)
@@ -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/branches/releasebranch_7_6/vector/v.vect.stats/main.c
===================================================================
--- grass/branches/releasebranch_7_6/vector/v.vect.stats/main.c	2019-03-06 22:30:52 UTC (rev 74168)
+++ grass/branches/releasebranch_7_6/vector/v.vect.stats/main.c	2019-03-06 22:31:36 UTC (rev 74169)
@@ -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/branches/releasebranch_7_6/vector/v.vect.stats/v.vect.stats.html
===================================================================
--- grass/branches/releasebranch_7_6/vector/v.vect.stats/v.vect.stats.html	2019-03-06 22:30:52 UTC (rev 74168)
+++ grass/branches/releasebranch_7_6/vector/v.vect.stats/v.vect.stats.html	2019-03-06 22:31:36 UTC (rev 74169)
@@ -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