[GRASS-user] query raster cell and its neighbors by point

Nikos Alexandris nik at nikosalexandris.net
Thu Mar 14 12:29:28 PDT 2013


Shaun Langley wrote:
> I need to easily query a raster and return both the value of the cell and
> the aggregate value of the 8-cell neighborhood, given a set of point
> coordinates.  I know I can easily do this with r.mapcalc, but that involves
> running the computation for the entire map even though I'm only interested
> in a very very small portion.  Is there an easier way to do this or am I
> stuck with the long solution?

What kind of an aggregation exactly?  Maybe not straight-through, but
I think you will be "forced" to use G7:

http://grass.osgeo.org/grass70/manuals/r.neighbors.html

in a way like

r.neighbors \
input=QueriedRaster \
selection=CellsOfInterest \
output=AggregatedRaster \
method=SomeMethod[,MoreMethods,EvenMoreMethods] \
size=3 \
title="Aggregated raster map"

However, you say you need the "queried" cell-value as well. Maybe combine with

http://grass.osgeo.org/grass70/manuals/r.what

Best, Nikos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130314/a67a8ec6/attachment.pgp>


More information about the grass-user mailing list