I have a DEM, resampled at 100 x 100 and clip by mask with a polygon.

Unique values report give me Total pixel count: 733810 with NODATA pixel count: 427098.

Aspect and Slope map give me the same number of pixels but NODATA pixel count: 423251.

My question is why when i clip by extent or clip by mask , area around my raster has NODATA values? How can i get rid of these so have same amount of pixels to every parameter? The problem doesnt solves if i reclassify them with zero because i need to export them to csv and analyze them and need exactly same number of pixels.

enter image description here


1 Answer 1


A raster has to be rectangular, that is why you get no data values when you clip with a irregular polygon. Maybe slope and aspect cant be calculated at the border to no data. Can you calculate them first then clip?

  • This worked for parametres that arise from DEM but when im creating distance to rivers map with same layer extent, same CRS, same spatial resolution, the 2 layers dont stack exactly one to another and have more NODATA pixels. Any idea ?
    – Kostas Pl.
    Jul 19, 2022 at 20:58

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.