<p dir="ltr"><br>
Hi Claus,</p>
<p dir="ltr">> ---------- Messaggio inoltrato ----------<br>
> From: Claus Backalarz <<a href="mailto:cb@delta.dk">cb@delta.dk</a>><br>
> To: "<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>" <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>><br>
> Cc: <br>
> Date: Thu, 10 Mar 2016 11:52:15 +0000<br>
> Subject: [Qgis-user] Select heights from a raster layer<br>
><br>
> But we want with (a lot) of polygons representing buildings to select all surface heights inside this polygons. The selected heights should afterward be saved as a reduced raster layer or, even better, as a shape file of points with an attribute for the heights. In other words as a layer of points with one and only one attribute, the surface height.<br>
><br>
> Do anybody have a useful way out of this problem ?<br>
><br>
The following is one of many ways to reach your goal (mainly coming from GRASS GIS approach and tools but should be feasible with QGIS, as you can also take advantage of processing tools):</p>
<p dir="ltr">1. Rasterize your polygon shapefile. Transform it in a raster map with the same resolution of your DSM. Each rasterized polygon will have the same value.</p>
<p dir="ltr">2. Use raster map algebra to select DSM height values from pixels that overlap rasterized polygon map, and set to null all other values.</p>
<p dir="ltr">The result should be the map you are looking for. If you need it as a point map, simply vectorize the raster map. You will get a vector point map with each point representing a pixel and height as an attribute (unless you want to create 3d points).<br>
You can now export the result in any file format.</p>
<p dir="ltr">Hope this helps, sorry if I don't provide you correspondence with QGIS tools to be used, but the procedure should be clear enough.</p>
<p dir="ltr">Bye,</p>
<p dir="ltr">Carlo</p>