[GRASS5] [bug #2061] (grass) r.los needs FP update

Markus Neteler neteler at itc.it
Thu Aug 14 11:29:10 EDT 2003


On Thu, Aug 14, 2003 at 04:17:14PM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > > > Subject: r.los needs FP update
> > > > 
> > > > grass binary for platform: Compiled from Sources
> > > > 
> > > > After inspection of the source code (due to unsatisfying results)
> > > > it seems that 'r.los' only works with CELL elevation data:
> > > > 
> > > > src/raster/r.los/cmd/main.c:
> > > >          /*  allocate buffer space for row-io to layer           */
> > > >          cell = G_allocate_cell_buf();
> > > >          /*      open elevation overlay file for reading         */
> > > >          old = G_open_cell_old (elev_layer, old_mapset);
> > > > etc.
> > > > 
> > > > The module should be fixed to also accept FCELL/DCELL DEMs.
> > > > However, I have no clear idea how much work is needed for
> > > > that as segmentation is used internally.
> > > 
> > > It should probably be changed to just use either FCELL or DCELL
> > > internally. I don't see any reason to preserve the underlying data
> > > type.
> > 
> > Sounds good - but the segment library (src/libes/segment/) seems
> > to be limited to CELL.
> 
> That contradicts the documentation, which implies that the cells may
> have arbitrary size; i.e. a cell is just "len" bytes, where "len" is
> given in the call to segment_format(). Cursory examination of the code
> supports the documentation.

OK - I tried to update the code and ended up with
WARNING: can't put float row into integer map

That's why I assumed (after a *quick* grep for CELL in segment)
that's related to segment. So there must be another oversight
in my updated r.los code. Mhhh.

Markus




More information about the grass-dev mailing list