[Gdal-dev] gdal_contour missing contours!

Frank Warmerdam warmerdam at pobox.com
Sat Jan 7 11:24:08 EST 2006


On 1/7/06, Jeshua Lacock <jeshua at openosx.com> wrote:
>
> Hello,
>
> This is almost certainly a user error, though I cannot figure it out.
>
> I have a DEM (from NED imported to a new location with r.in.gdal -oe)
> in GRASS that reports that the min/max Z values are:
>
>    min = 958.760071 max = 2162.167236
>
> But when I export it to a TIFF (with r.out.tiff) and use the command:
>
>         gdal_contour -a elev mydem.tif my-countours -i 10.0
>
> It successfully creates a shape file with levels going in increments of
> 10 from 0 to 250. But there are many missing levels (below 0 and above
> 250), for example see:
>         <http://OpenOSX.com/missing-contours.png>
>
> A sample TIFF of the DEM is here:
>
>         http://OpenOSX.com/mydem.tif
>
> How would I get gdal_contour to use the same values for the cells that
> GRASS uses (not 0-250, but the actual DEM elevation values)? Or short
> of that, how would I get it to draw all of the contours?

Jeshua,

mydem.tif isn't a DEM, it's a colored encoding of a DEM
in RGB.   You need to generate the DEM against the
original DEM data.

warmerda at gdal2200[6]% gdalinfo -mm mydem.tif
Driver: GTiff/GeoTIFF
Size is 339, 467
Coordinate System is `'
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  467.0)
Upper Right (  339.0,    0.0)
Lower Right (  339.0,  467.0)
Center      (  169.5,  233.5)
Band 1 Block=339x8 Type=Byte, ColorInterp=Red
    Computed Min/Max=0.000,255.000
Band 2 Block=339x8 Type=Byte, ColorInterp=Green
    Computed Min/Max=0.000,255.000
Band 3 Block=339x8 Type=Byte, ColorInterp=Blue
    Computed Min/Max=0.000,255.000


Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list