>Pedro Roma:
>
>I want to develop a script that crops a raster in order to only have the
>pixels that are located inside a vector polygon. 

There is probably a more elegant solution, but this will do:

g.region vect=your_vector
v.to.rast input=your_vector output=your_vector_rasterized use=val
r.mask input=your_vector_rasterized
r.mapcalc "clipped_raster=original_raster"
r.mask -r

Hope this helps,

Marcello.
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/A-Script-that-only-selects-raster-inside-a-polygon-tp5567368p5567467.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to