-1

enter image description here

I want to calculate, which land areas of my elevation raster data set are under a specific elevation height. The open sea with pixel values of 0 should not be included in the analysis. I want to convert the pixel values of only the open sea (and not the landmass) from 0 to noData, how can I do this without clipping or masking my raster with boundary shapefiles of the coastline or the country?

  • 1
    Mark 0 as nodata in Layer-Properties-Transparency. Nodata is just metadata, you tell that certain pixel value means nodata. No need nor possibility to convert pixel values into something that is definitely nodata. – user30184 Nov 26 '20 at 12:01
  • 2
    If all 0-values are set to NoData, then you'll also loose lakes and other things that should be kept. A better approach would be to mask out the water by having a land-mask, and inverting that to be a sea-mask. – Mikkel Lydholm Rasmussen Nov 26 '20 at 12:04
  • That is DEM, lakes should be above the sea level. But yes, there may be something else than sea with height 0. Masks are fine, unfortunately programs often support only nodata. – user30184 Nov 26 '20 at 12:27
  • What GIS software are you using? – BERA Nov 26 '20 at 14:51
  • With SAGA raster calculator, accessible also from QGIS, you can generate nodata values, see gis.stackexchange.com/a/129629/88814 – babel Nov 26 '20 at 15:32
0

Your technical issue is quite easy to solve. Using the raster calculator you can use a conditionnal statement

Con("yourraster"!=0 , "yourraster")

Which will replace all 0 by NoData ( "condition": your raster is different from 0, "if true": you use the value of your raster, "if false" is left void, so it will be NoData)

Conceptually, this is another problem because some land pixels have an elevation equal (or even below) 0 (e.g. a large part of the Netherlands or the "dead sea" area). So this rule could be problematic and the use of an external mask is recommended. It depends on your knowledge of your data (do small water bodies in your DEM have a positive elevation) and study area (any land area below sea level ? )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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