Opened 13 years ago

Closed 8 years ago

#942 closed enhancement (fixed)

v.univar: please add support for geometry statistics

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Default Version: svn-trunk
Keywords: vector, statistics Cc:
CPU: Unspecified Platform: Unspecified


It would be great to have (via flag?) the possibility to generate the univar stats of x,y[,z] point geometry for analysing optimal random sampling, interpolation and such. Support for points might be sufficient for most cases. Perhaps heuristics are sufficient (like in the lidar tools in GRASS 7).

thanks, Markus

Change History (3)

comment:1 by hamish, 13 years ago

really dumb and inefficient emergency workaround:

  • g.region rows=1 cols=1
  • x=1 y=2 z=1 out=x_mean
  • r.univar x_mean


or just use v.out.ascii + awk. see this script for calc'ing the mean:


that script could probably get a flag to also output numbers for variance,stddev without too much work.


comment:2 by wenzeslaus, 9 years ago

Does the following helps?

Pietro Zambelli in Object-based image classification in GRASS at grass-dev (nabble):

v.stats r58637 => Extract statistics from a vector map

(statistics about shape and about raster maps). v.stats internally use (in grass-addons):

  • v.area.stats r58636 => extract some statistics about the shape (in grass-addons);
  • => re-convert the vector to a raster map using the vector categories to be sure that there is a correspondence between vector and raster categories (zones).
  • r.univar2 r58439 => extract some general statistics from raster using the zones (consume much less memory than r.univar, and compute more general statistics like: skewness, kurtosis, and mode (in grass-addons);

comment:3 by neteler, 8 years ago

Resolution: fixed
Status: newclosed

This got solved long time ago:

-d Calculate geometry distances instead of table data

Note: See TracTickets for help on using tickets.