[gdal-dev] gdal_translate crash

Markus Neteler neteler at i...
Thu Feb 7 10:04:29 EST 2002


On Thu, Feb 07, 2002 at 08:24:00AM -0500, Frank Warmerdam wrote:
> 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.

Frank,

thanks for the quick reply. Here we are:

(gdb) run -co "TILED=YES" -co "TFW=YES" -of GTiff -ot Byte
/cdrom/dtm/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.

Program received signal SIGSEGV, Segmentation fault.
0x40310058 in __strcasecmp (s1=0x0, s2=0x40170b8f "unknown") at
../sysdeps/generic/strcasecmp.c:64

(gdb) bt
#0 0x40310058 in __strcasecmp (s1=0x0, s2=0x40170b8f "unknown") at
../sysdeps/generic/strcasecmp.c:64
#1 0x4008d495 in GTIFSetFromOGISDefn () at eval.c:41
#2 0x40083f71 in GTiffDataset::WriteGeoTIFFInfo () at eval.c:41
#3 0x40083321 in GTiffDataset::~GTiffDataset () at eval.c:41
#4 0x400e2371 in GDALClose () at eval.c:41
#5 0x8049964 in main () at eval.c:41
#6 0x402a8306 in __libc_start_main (main=0x8048ecc <main>, argc=11,
ubp_av=0xbfffda74, init=0x8048a98 <_init>, fini=0x80499c0 <_fini>,
rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbfffda6c) at
../sysdeps/generic/libc-start.c:129

Now I will recompile GDAL with "-g", probably that's what you need.

> 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.

Yes, that would be great.

Thanks,

Markus




More information about the Gdal-dev mailing list