Opened 9 years ago

Closed 4 years ago

#3880 closed enhancement (wontfix)

gdaldem: Allow nodata values to be treated as 0m

Reported by: Leith Bade Owned by: warmerdam
Priority: normal Milestone:
Component: Utilities Version:
Severity: normal Keywords: gdaldem
Cc:

Description

I have a DEM that uses nodata for the sea.

Unfortunately when you use gdaldem's hillshade it erodes the coastline with nodata, even if I use the new -compute_edges option.

Can you please add the ability to treat nodata as a specific value, instead of skipping it?

That way I can tell gdaldem to use 0m for nodata for my DEM.

Something like "-nodata_height 0".

It would be nice to see this slipped into 1.8.0 as it would only need a small change.

I will see if I can make a patch for gdaldem.cpp

Change History (3)

comment:1 Changed 9 years ago by Even Rouault

In r21290, I've added a way to unset the nodata flag in gdal_translate, so you could try the following workflow :

gdalwarp src.tif src_nodata_remapped.tif -dstnodata 0
gdal_translate src_nodata_remapped.tif src_remapped.tif -a_nodata none
gdaldem src_remapped.tif

First step will "convert" the nodata value of your source file (e.g. -32768) to 0. Second step will unset the nodata flag so that 0 is considered as a regular value.

comment:2 Changed 4 years ago by Even Rouault

Milestone: 1.8.1

Removing obsolete milestone

comment:3 Changed 4 years ago by Even Rouault

Resolution: wontfix
Status: newclosed

There are workarounds. Closing

Note: See TracTickets for help on using tickets.