[GRASS5] Re: [GRASSLIST:2833] core dumps after i.rectify

Glynn Clements glynn.clements at virgin.net
Tue Jan 1 00:10:08 EST 2002


Markus Neteler wrote:

> > After I changed 'format' from 0 to 1 everything seems to wrok fine. So
> > i.rectify apparently sets this wrong (at least in some cases).
> 
> Wow - excellent. Now we have to identify the problem in i.rectify.
> A candidate is
> src/imagery/i.rectify2/rectify.c
> [...]
>    G_set_cell_format (cellhd.format);

grass at gevaerts.be wrote:

> > > After I changed 'format' from 0 to 1 everything seems to wrok fine. So
> > > i.rectify apparently sets this wrong (at least in some cases).
> 
> Another possibly related problem : if the source raster is not compressed,
> the rectified raster is compressed, but marked as not compressed.

Both of these problems seem rather odd, as src/libes/gis/closecell.c
does this:

        if ( FCB.map_type != CELL_TYPE)
           FCB.cellhd.format = -1;
        else /* CELL map */
	   FCB.cellhd.format = FCB.nbytes - 1;

	FCB.cellhd.compressed = (open_mode == OPEN_NEW_COMPRESSED ? 1 : 0);
/* write header file */
        G_put_cellhd (FCB.name, &FCB.cellhd);

IOW, both the "format" and "compressed" fields which are written to
the "cellhd" file are being set to the values which should have been
used in writing the "cell" file.

Unfortunately, this problem is almost impossible to track down simply
by looking at the source. Cell_head structures are used and modified
in far too many places, both in libgis and i.rectify, to keep track
of. Someone will need to trace through i.rectify with a debugger,
observing all of the changes to the format/compressed fields in all of
the Cell_head structures.

PS: this would probably be easier if the G_fork() stuff was removed.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list