Changeset 13384

Show
Ignore:
Timestamp:
12/18/07 23:13:02 (5 months ago)
Author:
mloskot
Message:

Fixes for handling NaN values when calculating raster statistics ported to branches/1.5 (Ticket #1672)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal

    • Property svn:ignore changed from
      *~
      *.dll
      *.exe
      *.exp
      *.ilk
      *.lib
      *.ncb
      *.obj
      *.pdb
      *.suo
      *.swp
      *.vcproj.*.user
      *.*.manifest
      config.log
      GDALmake.opt
      mynmake.opt
      libgdal.*
      config.status
      libtool
      autom4te.cache
      tags
      ID
      Debug
      Release
      .libs
      .deps
      lib
      to
      *~
      *.dll
      *.exe
      *.exp
      *.gdb*
      *.ilk
      *.lib
      *.ncb
      *.obj
      *.pdb
      *.suo
      *.swp
      *.vcproj.*.user
      *.*.manifest
      config.log
      GDALmake.opt
      mynmake.opt
      libgdal.*
      config.status
      libtool
      autom4te.cache
      tags
      ID
      Debug
      Release
      .libs
      .deps
      lib
  • branches/1.5/gdal/gcore/gdal_misc.cpp

    r13162 r13384  
    596596                  case GDT_Float32: 
    597597                    dfValue = ((float *) poBlock->GetDataRef())[iOffset]; 
     598                    if( CPLIsNan(dfValue) ) 
     599                        continue; 
    598600                    break; 
    599601                  case GDT_Float64: 
    600602                    dfValue = ((double *) poBlock->GetDataRef())[iOffset]; 
     603                    if( CPLIsNan(dfValue) ) 
     604                        continue; 
    601605                    break; 
    602606                  case GDT_CInt16: 
     
    608612                  case GDT_CFloat32: 
    609613                    dfValue = ((float *) poBlock->GetDataRef())[iOffset*2]; 
     614                    if( CPLIsNan(dfValue) ) 
     615                        continue; 
    610616                    break; 
    611617                  case GDT_CFloat64: 
    612618                    dfValue = ((double *) poBlock->GetDataRef())[iOffset*2]; 
     619                    if( CPLIsNan(dfValue) ) 
     620                        continue; 
    613621                    break; 
    614622                  default: 
  • branches/1.5/gdal/gcore/gdalrasterband.cpp

    r13287 r13384  
    30033003                  case GDT_Float32: 
    30043004                    dfValue = ((float *) poBlock->GetDataRef())[iOffset]; 
     3005                    if (CPLIsNan(dfValue)) 
     3006                        continue; 
    30053007                    break; 
    30063008                  case GDT_Float64: 
    30073009                    dfValue = ((double *) poBlock->GetDataRef())[iOffset]; 
     3010                    if (CPLIsNan(dfValue)) 
     3011                        continue; 
    30083012                    break; 
    30093013                  case GDT_CInt16: