<div dir="ltr">Thank you very much Micha. I only seldom use GRASS, but maybe is the only way.<div>Bye</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 27, 2013 at 10:12 PM, Micha Silver <span dir="ltr"><<a href="mailto:micha@arava.co.il" target="_blank">micha@arava.co.il</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
    
  
  <div style="direction:ltr" bgcolor="#FFFFFF" text="#000000"><div class="im">
    <div>On 07/27/2013 10:10 PM, Giacomo
      Fontanelli wrote:<br>
    </div>
    <blockquote 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></div>
    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 type="cite"><div class="im">
      <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></div>
      This mail was received via Mail-SeCure System.<br>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Qgis-user mailing list
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>

This mail was received via Mail-SeCure System.


</pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <br>
    <pre cols="72">-- 
Micha Silver
GIS Consultant, Arava Development Co.
<a href="http://www.surfaces.co.il" target="_blank">http://www.surfaces.co.il</a></pre>
  </font></span></div>

</blockquote></div><br></div>