[GRASS5] v.in.ascii updates
Hamish
hamish_nospam at yahoo.com
Sun Mar 20 18:45:37 EST 2005
> > Also if can puts an indicative for the format to
> > import the values "columns='variable double f8.2' "
> > for when it be used with other instruction put excatly
> > the format that was reading; p.e. "d.vect -c file
> > display=attr attrcol=variable"
>
> [problem: 'd.vect display=attr attrcol=double' displays .000000 after
> every number cluttering the entire screen]
>
> Sorry, can't do that as it is an output rather than an input filter.
..
> You could possibly import your formatted numbers as a text string. [I
> don't know if it will let you force varchar type though (in the past
> it did not).] But this is wasteful.
..
> You could change lib/db/dbmi_base/valuefmt.c
>
> db_convert_value_to_string()
> [...]
> case DB_C_TYPE_DOUBLE:
> sprintf (buf, "%lf",db_get_value_double(value));
>
> "%lf" to "%g", but I worry this will break other things?
> Maybe it is ok, I don't know. Radim would have to answer that.
>
> This works for the d.vect case and the results look good!
.. but when you query a point with d.what.vect, the eastings and
northings columns show up like '2.04269e+06' which is not preferred.
I guess you could make the above case statement use %lf if e+04 to e+07,
else %g for a coordinate friendly version of text formatting.
Hamish
More information about the grass-dev
mailing list