[GRASS-dev] [GRASS GIS] #1346: v.in.ascii support for IEEE fp nan, inf

GRASS GIS trac at osgeo.org
Wed Apr 13 02:30:37 EDT 2011


#1346: v.in.ascii support for IEEE fp nan, inf
-------------------------+--------------------------------------------------
 Reporter:  hamish       |       Owner:  grass-dev@…              
     Type:  enhancement  |      Status:  new                      
 Priority:  minor        |   Milestone:  6.4.2                    
Component:  Vector       |     Version:  svn-trunk                
 Keywords:  v.in.ascii   |    Platform:  All                      
      Cpu:  All          |  
-------------------------+--------------------------------------------------
 Issue migrated here from the old RT bug system # 2763, and trac #198.

 http://intevation.de/rt/webrt?serial_num=2763

 Fri, Dec 3 2004 Hamish wrote:
 > I want to input "nan" into a double precision column, it complains
 > "column foo defined as double has string values"
 >
 > 'nan' and 'inf' are valid IEEE float/double values;
 >   scanf "%f" reads them, etc.
 Radim replied:
 > Added to my TODO > 6.0
 Markus:
 > please try 'NULL' instead of 'nan'.

 doesn't work. turns the column into string even if defined as double with
 columns=

 H:
 > nan, inf are valid float/double values and should be scanned as such
 > from incoming raw float data. AFAIK sscanf does read it as a valid %f.
 ...
 > My current work around is:
 >  sed -e 's/nan//g'
 Jul 8 2006 Markus suggested:
 if(column= type is specified as double prec)
 > G_str_replace(incoming line, "nan", "");

 but it would be good to also catch "inf", "NaN", and perhaps "NULL".


 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1346>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list