[GRASS-dev] patch for v.voronoi/v.delaunay

Hamish hamish_b at yahoo.com
Sat May 3 01:41:00 EDT 2008


> Markus wrote:
> > It seems that the precision gets somewhere lost in
> > db_convert_column_value_to_string()
> > 
> > i.e. lib/db/dbmi_base/columnfmt.c
> > 
> > but I don't find where is is rounded.
> 
Hamish:
> lib/db/dbmi_base/valuefmt.c db_convert_value_to_string() does:
>         case DB_C_TYPE_DOUBLE:
>             sprintf (buf, "%lf",db_get_value_double(value));
>             G_trim_decimal(buf);
> 
> the %lf is rounding to %.6f?
> 
> maybe
> - "%lf"
> + "%.14f"
> 
> then let G_trim_decimal() remove any extra .00000s.
> 
> but maybe such noisy output is not always wanted. :-/
> (e.g. pretty output for d.what.vect tcl form)
> ?
> 
> FWIW v.out.ascii defaults to dp=8.
> 
> 
> for the v.colors script, SQL  "select * WHERE dbl_col = <FP number>" is
> always going to be problematic. 
> 
> the C way:
>  if( abs(test - value) < GRASS_EPSILON )


In the case of v.colors, the SQL set loop could be rewritten to avoid
this problem by matching to the cat number, not trying to logically match
the FP value.


Hamish



     
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



More information about the grass-dev mailing list