[gdal-dev] gdal_translate crash

Frank Warmerdam warmerdam at p...
Thu Feb 7 08:24:00 EST 2002


Markus Neteler wrote:
> Hi,
> 
> today we tried to convert a ESRI HDR coverage to GeoTIFF for 
> MapServer usage:
> ls dgm_20m/
> dblbnd.adf hdr.adf log prj.adf sta.adf w001001.adf w001001x.adf
> 
> gdalinfo ./dgm_20m
> Driver: AIG/Arc/Info Binary Grid
> Size is 8184, 5159
> Coordinate System is:
> PROJCS["unnamed",
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",9],
> PARAMETER["central_meridian",0],
> PARAMETER["scale_factor",0.99964],
> PARAMETER["false_easting",1500000],
> PARAMETER["false_northing",0],
> UNIT["METERS",1]]
> Origin = (604160.000000,221420.000000)
> Pixel Size = (20.000000,-20.000000)
> Corner Coordinates:
> Upper Left ( 604160.000, 221420.000)
> Lower Left ( 604160.000, 118240.000)
> Upper Right ( 767840.000, 221420.000)
> Lower Right ( 767840.000, 118240.000)
> Center ( 686000.000, 169830.000)
> Band 1 Block=256x4 Type=Float32, ColorInterp=Undefined
> Min=194.364/1, Max=3893.104/1
> NoData Value=65536
> 
> Translating it:
> 
> gdal_translate -co "TILED=YES" -of GTiff -ot Byte dgm_20m dgm20_bolz.tif
> Size is 8184, 5159
> 0.Band 1 Type = 6
> ..10...20...30...40...50...60...70...80...90...100 - done.
> Segmentation fault (core dumped)
> 
> ls -l dgm20_bol*
> -rw-r--r-- 1 fauna uxbgroup 44045726 Feb 7 11:23 dgm20_bolz.tif
> 
> It crashes obviously when writing the .tfw file.
> 
> We also tried to directly specify the coverage in MapServer. The
> outline of map is visible, but all colors are white and a few
> pixels of grey. 
> 
> Little lost with this problem,
> looking forward assistance,
> thanks,

Markus,

I tried a similar translation with no apparent problem. Perhaps you could
run it in the debugger and report a traceback where it crashed? I doubt it
crashed while writing the .tfw file, since you need the "TFW=YES" option
to generate a .tfw file with the .tif file. It may have crashed while
closing down the output dataset if there was some sort of memory corruption.

As for the white/grey color the problem is that when you force the output
type to byte, it just copies over pixel values without scaling. Values
larger than 255 are clipped to 255 which would appear to be most of your
data.

I could add a "-scale src_min src_max [dst_min dst_max]" option to gdal_translate
if you would like, for scaling purposes.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
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