[GRASS-dev] v.what.rast support for centroids, v.rast.stats speed, r.category update

Hamish hamish_nospam at yahoo.com
Tue Oct 9 08:42:13 EDT 2007


Hi,

any comments re. the following patch?

it lets you use v.what.rast for centroids as well as points.

I have made a (100m) buffer around a number of points, and in addition to
the raster stats for the buffer provided by v.rast.stats I want to know
the exact value at the center point (field sampling station). In this
case my centroid is exactly in the middle of the area so it's ok. I'm not
so sure that this patch is useful when the centroid is randomly placed
within the area, hence this email. Then again the result is actually
uploaded to the centroid, not the area, so maybe all-correct just
sometimes requires a grain of salt in the interpretation.

???


Another issue touched by a recent thread* re. bounding boxes of features
within a vector map: v.rast.stats is VERY slow. This is because it creates
a r.mapcalc MASK at the full raster region resolution for each cat it
processes. When picking out small vector buffers from a large raster this
is highly inefficient. It would be much better to find the bounding box
of each selected vector cat, zoom in on it with the GRASS_REGION or
WIND_OVERRIDE enviro variables for the duration of the r.mapcalc and
r.univar calls for each cat.

[*] http://thread.gmane.org/gmane.comp.gis.grass.user/20327

I would be cool to have a C module which could do 'v.info -g' bounds for
cats=1,3,5-9,13 &/or where='SQL query'.  ??


Hamish

ps- r.category label setting updates are mostly done, it just needs some
cleaning. I expect it will need more testing and debugging than most
changes as the labeling lib fns are very dusty.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vwr_centroids.diff
Type: text/x-diff
Size: 1039 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20071010/7b2aa50f/vwr_centroids.bin


More information about the grass-dev mailing list