Skip to content
Permalink
Browse files

handle better null values

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12924 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Feb 11, 2010
1 parent 389cbb4 commit 8bc36d622a4e93ee27e6354aa9343d5f00d627d6
Showing with 14 additions and 2 deletions.
  1. +14 −2 src/providers/grass/qgis.g.info.c
@@ -108,6 +108,8 @@ int main( int argc, char **argv )
rast_type = G_get_raster_map_type( fd );
cell = G_allocate_c_raster_buf();
dcell = G_allocate_d_raster_buf();
void *ptr;
double val;

if ( rast_type == CELL_TYPE )
{
@@ -116,7 +118,8 @@ int main( int argc, char **argv )
G_fatal_error(( "Unable to read raster map <%s> row %d" ),
rast_opt->answer, row );
}
fprintf( stdout, "value:%d\n", cell[col] );
val = cell[col];
ptr = &(cell[col]);
}
else
{
@@ -125,7 +128,16 @@ int main( int argc, char **argv )
G_fatal_error(( "Unable to read raster map <%s> row %d" ),
rast_opt->answer, row );
}
fprintf( stdout, "value:%f\n", dcell[col] );
val = dcell[col];
ptr = &(dcell[col]);
}
if ( G_is_null_value( ptr, rast_type ) )
{
fprintf( stdout, "value:null\n" );
}
else
{
fprintf( stdout, "value:%f\n", val );
}
}
G_close_cell( fd );

0 comments on commit 8bc36d6

Please sign in to comment.
You can’t perform that action at this time.