I have a raster DEM and I want to extract from it the highest point found in every polygon of a polygon shapefile.

The result that I would like to obtain would be a point shapefile with 2 collumns: polygon ID and height.

I'm working in QGIS.

I tried SAGA raster statistics to polygon, but the result is just a polygon with the height value. I am trying to extract the point to a point vector layer.

  • Welcome to GIS SE. As a new user, please take the Tour. We are not a tutorial site. All questions are expected to contain not only what you need to do, but what you have attempted, and what has gone wrong.
    – Vince
    Commented Sep 19, 2017 at 10:31
  • See here a model that does this: gis.stackexchange.com/a/461322/88814
    – Babel
    Commented Jun 26 at 13:16

5 Answers 5


You can use saga - raster values to points. Then use "join attributes by location" to join the points to the polygon layer. You can then select the max value from the attribute table of the joined points/polygon layer using "statistics by categories"

  • Thanks for the help. But the problem i'm finding with this solution, is that the point shapefile doesn't make a distinction between polygons. When i ask for the max value of the layer, it returns me the maximum value of all polygons. What I am expecting is the maximum value for each polygon. Can anyone help me'
    – Hugo Silva
    Commented Sep 19, 2017 at 12:02
  • @HugoSilva Sorry I missed a step. I've edited my answer. Should work now Commented Sep 19, 2017 at 12:14
  • 2
    +1 and just to add; Raster values to points has an option Polygons to which you can assign your polygon layer. Then by activating Iterate over this layer (green rounded arrow), you can produce 1 point layer per each polygon.
    – Kazuhito
    Commented Sep 19, 2017 at 12:44
  • Sorry, i'm a bit new in working with rasters. statistics by categories outputs a csv file. Is there anyother workaround? I was expecting some command to extract the location and height of the highest point in a polygon. Any clues?
    – Hugo Silva
    Commented Sep 19, 2017 at 13:40
  • Try 'zonal statistics' from the processing toolbox Commented Sep 19, 2017 at 13:48

Original question was certainly using QGIS 2.x so many algorithms have been added since. I don't know if this method could be used pre QGIS 3.x but it's certainly relevant now anyway.

I needed to do something similar where I wanted to locate more precise high points with the help of lidar data. My original high points were contained in a point layer that was based off much less precise raster data so what I turned out doing achieves what you were trying to do yourself.

There was no practical way to do it generating one point for each pixel as the spatial resolution of 1m would have been way too heavy to deal with. An alternate method to the other two answers is to isolate the pixel with highest value, turn everything else into NODATA, and only then generate points from the raster. The null ones are ignored.

I built a model (in QGIS 3.4) where I could iterate over my point layer but it could be done with a polygon layer too. Here's the sequence (if you take a look at the model below, you'd start from the Bounding boxes tool which you can replace with your polygon layer):

  1. Clip raster by mask layer

    • Input: your raster layer
    • Mask: your polygon layer
  2. Zonal statistics

    • Raster layer: the result from step 1
    • Vector layer zones: your polygon layer
    • Statistics to calculate: Max
  3. Reclassify by layer

    • Raster layer: result from step 1
    • Layer containing class breaks: result from step 2
    • all value fields: _max (if you left the default field prefix in step 2)
    • Use no data when no range matches value: Yes
  4. Raster pixels to points

    • Raster layer: result from step 3

From this moment the output should be vector points at maximum pixel value from the original raster contained in your polygons. There are a few unneeded steps for you as I created a buffer around my original points to get polygons in which to find maximum values, and at the end I joined attributes from my bounding boxes so my output points would have the same attributes as my input points.

Of course, for this to work you have to click the button to iterate over your polygon layer, just like I had to iterate over my points. You'll have as many points layers as you had input polygons, but they can easily be merged into one layer afterwards.

enter image description here

enter image description here

  • This worked great. Just remember to also change class limits to <= x <= and then it works like a charm.
    – tjukanov
    Commented Jul 22, 2021 at 7:35

This is basically the same as the one provided by @firefly-orange already.

  1. Start SAGA Raster values to points tool. Select your raster layer as Grids.
  2. Select your polygon layer in the Polygon[optional] field and make sure to click on Iterate over this layer button. Then Run.

enter image description here

  1. You will obtain as many layers as your polygons. It will appear in reverse order on the layers panel, all named "Shapes". So you would probably want to rename these point layers to represent each of your polygon.
  2. Open any attribute table of newly created Shapes layer, and click twice on the header of your value column (the field name is automatically taken from your raster layer). The row with highest value comes on top. By hitting [CTRL+J] keys or Zoom map to the selected rows button, it will take you to the highest point.

enter image description here


Had same issue today: Get highest and lowes Alt from DEM within a polygon. I made a point grid with inbuilt tool "Create Grid", with reasonable X/Y spacing (10m i.e.) and set the extent of the polygon to be sampled. Then clip resulting grid points with polygon, and finally sample the DEM Raster with these points.. Easy as that!


You need a unique id column in your polygon layer.

  1. Clip raster by mask layer (your polygon layer)
  2. Raster pixels to points
  3. Join the polygon id to the points. If you have many points you should create Spatial indexes first to speed it up.
  4. Extract by expression the point with the highest raster value per polygon id: "VALUE"=maximum(expression:="VALUE", group_by:="polygonid"). Change polygonid to the name of your joined polygon id column.

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.