[GRASS-user] r.to.vect stats

Vaclav Petras wenzeslaus at gmail.com
Mon May 1 06:36:35 PDT 2017


On Mon, May 1, 2017 at 6:54 AM, Moritz Lennert <mlennert at club.worldonline.be
> wrote:

> On 01/05/17 12:43, Martin Landa wrote:
>
>> I need a tool which converts vector features (points) to raster map
>> using statistical method like min,max,mean (something like
>> `r.in.lidar` does - if more points are found within one cell, raster
>> value is computed by given method).
>>
>> I started with module `r.to.vect`, but it takes only one attribute
>> value if more features found, `v.kernel` does not support attributes.
>> There is probably such tool, I must overlook something...
>>
>
> I generally use v.to.db op=coor && v.db.select | r.in.xyz for such a
> task. I don't know if a dedicated module would be much faster than a script
> that wraps around these modules. I guess avoiding the v.to.db part could
> gain you some time when dealing with lots of points.


Hi, this is certainly a missing feature. Even the v.to.rast documentation
[1] says:

v.out.ascii input=myschools_wake output=- column=value | r.in.xyz input=-

For certain cases, you may be able to use v.out.lidar instead of
v.out.ascii, but it is probably less efficient (although it uses LAS
instead of ASCII, you can't use pipes). You could also use v.mkgrid with
rectangular grid and v.vect.stats [2] followed by v.to.rast (which avoids
export, but for large grids it is likely very slow).

I have separated the binning code in r.in.lidar [3] so that it can be used
in r.in.xyz and the missing module which would do the binning of a vector
map into a raster map. There is actually a large overlap with code for
grid-based decimation of a point cloud (2D with gridded or averaged X and
Y). I already committed the code to r.in.lidar [4], but we had a discussion
on mailing list and decided that this functionality should not be part of
r.in.lidar, so it is disabled [5] but the code is still there.

Anyway, a new module needs to be implemented for this. The name can be
something like r.binning, r.vect.stats, r.point.stats, or r.points.stats.
It might good project for beginners.

Vaclav

[1]
https://grass.osgeo.org/grass72/manuals/v.to.rast.html#convert-vector-points-to-raster-with-raster-cell-binning
[2]
https://grass.osgeo.org/grass72/manuals/v.vect.stats.html#point-statistics-in-a-hexagonal-grid
[3] https://trac.osgeo.org/grass/changeset/66595
[4] https://trac.osgeo.org/grass/changeset/67210
[5] https://trac.osgeo.org/grass/changeset/68418
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170501/7a826f63/attachment.html>


More information about the grass-user mailing list