I use gdaldem to calculate the slope of a given region. This is the command I use:

gdaldem slope -s 111120 -p -compute_edges  N34E069.hgt N34E069_slope.tif

(I've got the SRTM data from http://viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org3.htm)

Some values in the raster band however have the noData value -9999. In the documentation I just came accross this line:

The value -9999 is used as the output nodata value.

But, what is the reason for getting a nodata value? When I create a color-relief map with the following color code:

-9999 255 0 0 
0 255 255 255
90 0 0 0 

I get the following output: enter image description here

It seems like the noData values occur on the peaks of mountains. But on the left in the flat area I also get some noData values.

How can I fix this problem?

  • 1
    Have you checked that the input DEM does not have nodata values? Otherwise is seems that from some reason slope=0 becomes nodata in the slope map. – user30184 Apr 12 '17 at 6:19
  • Yeah, you were right! The input DEM file indeed had some strange values (-32768). I've used another file and now it works! – M F Apr 13 '17 at 8:11

Your Answer

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

Browse other questions tagged or ask your own question.