<html style="direction: ltr;">
<head>
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="preferred-charset"
bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 07/27/2013 10:10 PM, Giacomo
Fontanelli wrote:<br>
</div>
<blockquote
cite="mid:CAO5DHxE+SOZvtAFa2DzJoP--jH1aTjvpcb-XBNNawrekjJBJpA@mail.gmail.com"
type="cite">
<div dir="ltr">Hello everybody
<div><br>
</div>
<div>I would like lo extract the value of each pixel of a raster
below some polygons (of a vector layer).</div>
<div>Better if I could save the result in a text file.</div>
<div>
<br>
</div>
</div>
</blockquote>
<br>
You can do this using GRASS. First import both the vector polygons,
and the raster into GRASS:<br>
v.in.ogr <vector polygon.shp> out=polys type=area<br>
r.in.gdal <your raster> out=raster_map<br>
and set the GRASS region to the raster <br>
g.region -p raster_map<br>
THen convert polygons to a raster, and declare it a MASK:<br>
v.to.rast polys out=MASK type=area use=val value=1<br>
<br>
Now run r.out.xyz<br>
r.out.xyz raster_map out=raster_pixels.csv fs=","<br>
<br>
The module r.out.xyz honors the mask, so only those pixels covered
by the mask will be in the output file.<br>
<br>
<br>
<blockquote
cite="mid:CAO5DHxE+SOZvtAFa2DzJoP--jH1aTjvpcb-XBNNawrekjJBJpA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>The plugin "zonal statistics" does something similar, but
doesn't provide the list of the value of the pixels.</div>
<div><br>
</div>
<div>Does another plugin exist or do I have to make a new one
using python (very hard job for me).</div>
<div><br>
</div>
<div>Thank you very much</div>
</div>
<br>
This mail was received via Mail-SeCure System.<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>
This mail was received via Mail-SeCure System.
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
GIS Consultant, Arava Development Co.
<a class="moz-txt-link-freetext" href="http://www.surfaces.co.il">http://www.surfaces.co.il</a></pre>
</body>
</html>