Opened 15 years ago

Closed 10 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

Description

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, 15 years ago

really dumb and inefficient emergency workaround:

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

etc

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

source:grass-addons/vector/v.points.cog/v.points.cog

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

Hamish

comment:2 by wenzeslaus, 11 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);
  • v.to.rast => 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, 10 years ago

Resolution: fixed
Status: newclosed

This got solved long time ago:

http://grass.osgeo.org/grass70/manuals/v.univar.html

-d Calculate geometry distances instead of table data

Note: See TracTickets for help on using tickets.