<div dir="ltr"><div><div><div><div><div>Hi <br><br></div>it seems that it has to do something with no-data areas. gdal_contour tries to calculate all the contours from approx. 450m up to my no-data value -3.4...e+38.<br><br></div>I use no gdal_fillnodata.py to fill the no data areas.<br><br></div>So I still think there is a slighly different behaviour of gdal since my last calculations with the same commands and data with Ubuntu 10.04.<br><br></div>best regards<br></div>Stefan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 7, 2016 at 12:58 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Stefan,<br>
<span class=""><br>
> I have problems creating contours with gdal_contour and some tiff files.<br>
> The following command<br>
><br>
> gdal_contour -i 1.0 6800_2480.tif out.shp<br>
><br>
> ends with "0Killed" after eating all memory and all swap. It happens with<br>
> gdal 1.11 and gdal-master. It did work on a Ubuntu 10.04 machine (as far as<br>
> I remember). Now I'm on Ubuntu 14.04.<br>
<br>
</span>Comparing the source code, the algorithm hasn't fundamentaly changed, at least<br>
since GDAL 1.5. I can reproduce your issue with latest trunk or 1.5.X.<br>
It is related to the fact that your source dataset has floating point values.<br>
An easy workaround is to translate your raster into a Int16 one and contour<br>
it. I've just tried it and it works.<br>
Or you could possibly round values to 0.5 precision with gdal_calc.py for<br>
perhaps a smoother result. But basically the contour alg seems to require a<br>
lot of memory if every pixel is different from its neighbour (might be an<br>
approximation of what happens as the algorithm is non trivial and I didn't<br>
study it in detail).<br>
It might be worth opening a ticket on that.<br>
<br>
Even<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Tiff file can be found here:<br>
> <a href="http://maps.zh.ch/download/hoehen/2014/dtm/tif/6800_2480.tif" rel="noreferrer" target="_blank">http://maps.zh.ch/download/hoehen/2014/dtm/tif/6800_2480.tif</a><br>
><br>
> Any ideas?<br>
><br>
> regards<br>
> Stefan<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br></div>