[GRASS-user] speeding up context evaluation...

Glynn Clements glynn at gclements.plus.com
Tue Dec 2 13:52:30 EST 2008


Hufkens Koen wrote:

> for a validation exercise I need to extract the class values around certain pixel location.
> 
> I have a map with all the locations (numbered) and a map with the validation map.
> 
> The code you find below is the one I came up with to get this information (only output to terminal for the moment).
> 
> However, this code includes a loop and is terribly slow. Has anyone an idea how to speed things up?

If your groundtruth points are sufficiently spaced that their buffers
don't overlap[1], you can avoid the loop by creating a single buffer
map rather than one for each category.

[1] Or you can accept assigning overlapped cells to the nearest point.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list