> Has s.cellstats been ported to vectors under 5.7 yet?
Try v.univar (newer than 5.7.0).
From the online man page looks like s.univar which just calculates the stats
for the whole vector.
s.cellstats calculates the stats for each cell in the current region and
creates a site file with one site per cell and one attribute per statistic. I
don't see an output option in v.univar.
Specifically I've got a points vector file (old style sites) and I'd like a
raster where the value in each cell is the number of points that the vector
had that fall within the cell.
In 5.3 I could do:
s.cellstats in=sites out=count stats=n
s.to.rast in=count out=nrast
v.neighbors can calc number of cells in given radius,
not exactly what you want, but it could be also useful.
Radim
Gordon Keith wrote:
On Wed, 10 Nov 2004 17:37, Hamish wrote:
Has s.cellstats been ported to vectors under 5.7 yet?
Try v.univar (newer than 5.7.0).
From the online man page looks like s.univar which just calculates the stats
for the whole vector.
s.cellstats calculates the stats for each cell in the current region and creates a site file with one site per cell and one attribute per statistic. I don't see an output option in v.univar.
Specifically I've got a points vector file (old style sites) and I'd like a raster where the value in each cell is the number of points that the vector had that fall within the cell.
In 5.3 I could do: s.cellstats in=sites out=count stats=n
s.to.rast in=count out=nrast
> Specifically I've got a points vector file (old style sites) and I'd
> like a raster where the value in each cell is the number of points
> that the vector had that fall within the cell.
>
> In 5.3 I could do:
> s.cellstats in=sites out=count stats=n
> s.to.rast in=count out=nrast
>
> Does v.univar support this?
v.neighbors can calc number of cells in given radius,
not exactly what you want, but it could be also useful.
Resolution would have to be very small...
some ideas:
v.kernel will produce a raster density map.
I seem to rememeber when Paul updated s.surf.idw the new method binned
the points first.. maybe this could be adapted.. (long shot)
another idea to show areas of high and low point coverage:
r.cost then r.mapcalc*res to make distance to nearest point map; smooth
with r.neighbors-mean with a big search window. Not a density map per
se, but if you make a fine grid it may give the meaning you are looking
for.
So how much work is it likely to be to port s.cellstats to
v.cellstats?
depends on how good a C programmer you are
(or the quality of the person you can bribe)
(I'm also likely to want other stats such as median)
r.univar (and r.series) would be a good place to start. I don't think
it would be very hard.. there are several ways to do it, the question is
which is the most efficient.