[Qgis-user] extraction of the value of each pixel of a raster

Giacomo Fontanelli giacomofontanelli76 at gmail.com
Sat Jul 27 15:19:16 PDT 2013


Thank you very much Micha. I only seldom use GRASS, but maybe is the only
way.
Bye


On Sat, Jul 27, 2013 at 10:12 PM, Micha Silver <micha at arava.co.il> wrote:

>  On 07/27/2013 10:10 PM, Giacomo Fontanelli wrote:
>
> Hello everybody
>
>  I would like lo extract the value of each pixel of a raster below some
> polygons (of a vector  layer).
> Better if I could save the result in a text file.
>
>
> You can do this using GRASS. First import both the vector polygons, and
> the raster into GRASS:
> v.in.ogr <vector polygon.shp> out=polys type=area
> r.in.gdal <your raster> out=raster_map
> and set the GRASS region to the raster
> g.region -p raster_map
> THen convert polygons to a raster, and declare it a MASK:
> v.to.rast polys out=MASK type=area use=val value=1
>
> Now run r.out.xyz
> r.out.xyz raster_map out=raster_pixels.csv fs=","
>
> The module r.out.xyz honors the mask, so only those pixels covered by the
> mask will be in the output file.
>
>
>  The plugin "zonal statistics" does something similar, but doesn't
> provide the list of the value of the pixels.
>
>  Does another plugin exist or do I have to make a new one using python
> (very hard job for me).
>
>  Thank you very much
>
> This mail was received via Mail-SeCure System.
>
>
> _______________________________________________
> Qgis-user mailing listQgis-user at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/qgis-user
>
> This mail was received via Mail-SeCure System.
>
>
>
>
>
> --
> Micha Silver
> GIS Consultant, Arava Development Co.http://www.surfaces.co.il
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130728/4f0a4f5b/attachment.html>


More information about the Qgis-user mailing list