[GRASS-user] scientific notation

Dear R mailing list!

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 ?

Many thanks in advance

Jessica

I am not sure if GRASS can read scientific notation on v.in.ascii. Previously I have used something like open office or other spreadsheet program to reformat from SN to decimal. then export as CSV, import into GRASS with v.in.ascii.

On Nov 22, 2007 9:40 AM, <jessica.gervais@tudor.lu> wrote:

Dear R mailing list!

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 ?

Many thanks in advance

Jessica


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

hi,

2007/11/22, jessica.gervais@tudor.lu <jessica.gervais@tudor.lu>:

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 ?

no, it seems, v.in.ascii doesn't support it...

Martin

Many thanks in advance

Jessica

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

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