[GRASS-user] Selection of raster inside a polygon

Greetings

I have a raster map and I want to just select, without any major changes and shifts, the raster pixels that fall inside a certain polygon. How can I do this in GRASS?
Thanks Monica

hey

i´m going to work on the same "problem" ... take a look on r.mapcalc and
r.mask

I guess fist you have to convert your polygon to a raster and then based on
that raster it should be possible to use r.mapcalc or r.mask

cheers

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Selection-of-raster-inside-a-polygon-tp6185026p6185105.html
Sent from the Grass - Users mailing list archive at Nabble.com.

I did it that way:
1) import vector (v.in.ogr)
2) create a raster out of this vector (v.to.rast input=... output=...
column= "name of the column the holds the value")
3) create a mask, based on the created raster (r.mask input=... ) --> a new
raster called MASK is created
4) import the raster (r.in.gdal)

When I imported the raster, it wasn´t "clipped" to the mask, but when I
executed r.sun the result was "clipped" to the specified area ... see below
(the input raster was covering the defined region)

http://osgeo-org.1803224.n2.nabble.com/file/n6186042/r_sun.png r_sun.png

cheers

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Selection-of-raster-inside-a-polygon-tp6185026p6186042.html
Sent from the Grass - Users mailing list archive at Nabble.com.

2011/3/18 TimNorwey <timmy_weyrer@live.at>:

I did it that way:
1) import vector (v.in.ogr)

define region based on this vector map and define the resolution

$ g.region vect=<map> res=<value>

2) create a raster out of this vector (v.to.rast input=... output=...
column= "name of the column the holds the value")

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa