[gdal-dev] gdal_contour and "nodata" oceans

Even Rouault even.rouault at mines-paris.org
Tue Feb 23 17:00:31 EST 2010


Maxime,

you can try the following tricks to remap your nodata value from -32768 (this 
is type typical value for most DEM) to 0 :

1) gdalwarp -srcnodata -32768 -dstnodata 0 src_dem.tif out_dem.tif

2) or gdalbuildvrt -srcnodata -32768 -vrtnodata 0 out_dem.vrt src_dem.tif
(you need GDAL 1.7.1 for the latest)

and then use gdal_contour on out_dem.tif or out_dem.vrt

Le Tuesday 23 February 2010 21:54:26 Maxime Guillaud, vous avez écrit :
> Hi all,
>
> I am trying to have gdal_contour operate on SRTM data from CGIAR
> (http://srtm.csi.cgiar.org/). The problem is that this dataset has
> oceans set to "nodata". This creates ugly artifacts along the shores
> (you can see an example here on the red lines:
> http://www.mguillaud.net/tmp/Screenshot.png - in contrast, the blue
> contour lines were generated by gdal_contour from another DEM file with
> sea-level at zero - however I can not use this second data source
> because it has other defects).
>
> Now, I would like to either
> 1. set all "nodata" points to an arbitrary elevation (zero) directly
> in the GeoTIFF file, or
> 2. make gdal_contour assume that nodata means elevation zero.
>
> I would be grateful if anyone can point me to a way to do either of the
> above !
>
> cheers,
> Maxime
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list