[GRASS-dev] r.le--after some fixes still needs work

William L. Baker bakerwl at uwyo.edu
Thu Sep 28 17:56:28 EDT 2006


Hamish and Glynn, thank you for seeing that with null_buf. In
r.le.patch, I did indeed allocate null_buf as DCELL, not char and that
worked in there, even though it is not the right solution. Hamish, can
you change that allocation statement for null_buf to DCELL and see if
that fixes the crash? I'm not set up yet to do anything and can barely
figure out CVS at this point. Hope that fixes the crash.

Hamish, as to r.le.setup, at the CHOOSE THE SETUP OPTION step, I choose
Setup sampling units, then Use keyboard to enter sampling unit
dimensions, then 1 for for How many different SCALES, then 1 for Random
nonoverlapping, then "y" for Do you want to sample using rectangles,
then "1.0" for Sampling unit SHAPE, then 144 for Recommended maximum
SIZE followed by "y" it's OK, then 20
sampling units. At that point, the program should draw the sampling
units in red on the monitor, but nothing is displayed. Not sure where
the communication problem is...

Bill
On Thu, 2006-09-28 at 18:13 +0100, Glynn Clements wrote:

> Hamish wrote:
> 
> > > I tried r.le in CVS HEAD after Hamish made some fixes. The fixes took
> > > care of some problems.
> > ..
> > > But, r.le.pixel still crashes with memory bug
> > 
> > G63: spearfish> r.mapcalc elev=elevation.dem # it didn't like @othermapset
> > G63: spearfish> r.le.pixel elev att=b1
> > 
> > PARAMETER CHOICES:
> >         MAP:      elev
> >         SAMPLE:   whole map    
> >         ATTRIBUTE MEASURES:
> >                   mean pixel attribute
> > mkdir: cannot create directory `r.le.out': File exists
> > 
> > R.LE.PIXEL IS WORKING....;
> > 
> > Segmentation fault
> > 
> > 
> > 
> > this happens in G_free(), raster/r.le/r.le.pixel/cellclip.c line 417:
> > 
> >   switch (data_type) {
> >      case CELL_TYPE:
> >         G_free (tmp);
> >         break;
> > 
> > 
> > compile time warnings:
> > 
> > cellclip.c: In function `cell_clip_drv':
> > cellclip.c:82: warning: passing arg 2 of `cell_clip' from incompatible pointer type
> > cellclip.c:129: warning: passing arg 2 of `center_is_not_null' from incompatible pointer type
> 
> null_buf is being allocated with one char per column, but everything
> else assumes that it holds one DCELL per column (although, AFAICT,
> they only check for zero/non-zero).
> 
> The "right" solution is to change everything to treat it as char**;
> the easy solution is to allocate one DCELL per column.
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20060928/517a556e/attachment.html


More information about the grass-dev mailing list