[GRASS5] i.ortho.photo DEM reading problem

Markus Neteler neteler at itc.it
Wed Nov 26 05:38:48 EST 2003


Hello Paul,

sorry for not writing earlier - we have implemented your suggestion
and it seems to work well (the first solution from below).
I have submitted to CVS already.

Thanks for the quick help,

 Markus

On Wed, Nov 26, 2003 at 10:11:51AM +0000, Paul Kelly wrote:
> Hello Markus
> 
> On Tue, 25 Nov 2003, Paul Kelly wrote:
> 
> > Can you not force it to always read the map as a DCELL_TYPE (especially
> > seeing elevbuf is a pointer to a DCELL)? From reading previous messages
> > on the list I think this is a good practice unless you need to preserve
> > integer values as it will automatically convert the values to DCELL if the
> > map is CELL or FCELL?.
> >
> > Also further down
> > zz2 = (double) elevbuf[c2];
> > /* if target TIE point has no elevation, set to aver_z */
> > if (zz2 == 0) zz2 =  aver_z;
> > z2 = zz2;
> > looks very suspicious and should probably be using something like
> > G_is_d_null_value() instead of if (zz2 == 0).
> 
> Did your change work? My CVS write access isn't working right now
> (firewall problem here I think) and I can't test it anyway but if you
> still have problems with that part I would suggest changing
> ====
> zz2 = (DCELL) elevbuf[c2];
> /* if target TIE point has no elevation, set to aver_z */
> if ( G_is_d_null_value(&zz2) ) zz2 =  aver_z;
> z2 = zz2;
> ====
> to the following
> ====
> /* if target TIE point has no elevation, set to aver_z */
> if ( G_is_d_null_value( &elevbuf[c2] ) )
>     z2 = aver_z;
> else
>     z2 = (double) elevbuf[c2];
> ====
> and getting rid of zz2. The pointer use looks better to me but don't try
> it unless you're having trouble!
> 
> Paul
> 

-- 
Markus Neteler     <neteler at itc.it>       http://mpa.itc.it
ITC-irst -  Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18        -       38050 Povo (Trento), Italy




More information about the grass-dev mailing list