[GRASS-user] scientific notation

Hamish hamish_nospam at yahoo.com
Sun Nov 25 01:54:54 EST 2007


jessica.gervais wrote:

> Dear R mailing list!

(close enough)

> I would like to import points data in GRASS (with v.in.ascii).
> My data includes number written with the scientific notation (for example
> 1.2e+23).
> During the import, I am defining them as double.
> Unfortunately, it doesn't work...
> 
> I get the following message :
> " ERROR: Column 9 defined as double has string values "
> 
> Can GRASS actualy deal with number written with scientific notation ?
> Is there a specific way to deal with these numbers ?

v.in.ascii coulumn scanning code seems to overlook that case. 

There is an open bug report for it not dealing with "nan" and "inf" as doubles
too,  http://intevation.de/rt/webrt?serial_num=2763
I'd like to add this issue to that bug report but am not currently in a place
to log into to do that.

I had thought you could over-ride that by specifically defining the column type
with columns="east double, north double, ...", but no luck.


As a work-around you could use a little awk to reformat it, for example:
 echo "1.2e23 2.1e21" | awk '{printf("%.0f %.0f\n", $1, $2)}'


Hamish



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


More information about the grass-user mailing list