[GRASS-dev] [GRASS GIS] #2343: GRASS 7: "inf" values break insert statements in v.rast.stats

GRASS GIS trac at osgeo.org
Wed Jun 18 03:53:33 PDT 2014


#2343: GRASS 7: "inf" values break insert statements in v.rast.stats
--------------------------+-------------------------------------------------
 Reporter:  sbl           |       Owner:  grass-dev@…              
     Type:  defect        |      Status:  new                      
 Priority:  normal        |   Milestone:  7.0.0                    
Component:  Python        |     Version:  svn-releasebranch70      
 Keywords:  v.rast.stats  |    Platform:  All                      
      Cpu:  All           |  
--------------------------+-------------------------------------------------
 When running v.rast.stats on a dataset with small geometries (which in my
 case were represented by 2 pixels in the raster), the parameter
 "coeff_var" can result in "inf" value.
 "inf" breaks the INSERT statement and results in an DBMI error "no such
 column: inf", which at the end crashes v.rast.stats.

 Just like "nan", "inf" could be replaced by NULL. Changing line 263 in
 v.rast.stats.py into this:
 if value.lower().endswith('nan') or value.lower().endswith('inf'):
 should work.

 Both GRASS 7.0 and 7.1 are affected. Please find attached patches for both
 versions...

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



More information about the grass-dev mailing list