Browse Source

v.vect.stats: less cryptic error message; type casting hints added

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74168 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 6 years ago
parent
commit
36d0da1e41

+ 2 - 0
scripts/v.db.update/v.db.update.py

@@ -20,6 +20,8 @@
 #% keyword: vector
 #% keyword: attribute table
 #% keyword: database
+#% keyword: attribute update
+#% keyword: type casting
 #%end
 #%option G_OPT_V_MAP
 #%end

+ 1 - 1
vector/v.vect.stats/main.c

@@ -441,7 +441,7 @@ int main(int argc, char *argv[])
 	    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,

+ 9 - 2
vector/v.vect.stats/v.vect.stats.html

@@ -60,9 +60,16 @@ Points not falling into any area are ignored. Areas without category
 (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>