[GRASS-user] Extract single pixels with r.mapcalc?

LeventB solfallsild at gaia.de
Tue Jan 18 05:57:03 EST 2011


Hello Grass users!

I have the following problem:

Based on one raster map, i want to create a new map containing only eight
cells - four in the corners of the map and four on the middle of the edges -
with the category „1”. All other cells are supposed to be NULL-cells.
I thought about doing this via r.mapcalc - yet i do not know if there is any
possibility to manipulate only single cells with this command.
It all comes down to the question if one cell in a GRASS raster layer
actually contains information about its coordinates;(which i could include
in a r.mapcalc command) - or if it is really only defined by the edges of
the map, the resolution and the resulting number of cells?

Sorry for the sort of noobish question, i think i don't yet have complete
understanding of the GRASS raster format, though i read the related manual
pages.

I also know that i can reach the same result by simply digitizing a vector
map with the points in question, then running v.to.rast. But as i want to
make this operation part of a shell script, i'm eager to avoid (1) most
interactive operations and (2) the way to the vector format and back again.
Point 1 i could of course avoid by using v.edit, but there is still point 2.

Would be glad for any help!
Thanks,
Levent
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Extract-single-pixels-with-r-mapcalc-tp5935168p5935168.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list