Changeset 13434
- Timestamp:
- 12/21/07 13:17:20 (5 months ago)
- Files:
-
- branches/1.5/autotest/gdrivers/aaigrid.py (modified) (1 diff)
- branches/1.5/autotest/gdrivers/data/nodata_float.asc (modified) (1 diff)
- branches/1.5/gdal/frmts/aaigrid/aaigriddataset.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.5/autotest/gdrivers/aaigrid.py
r13407 r13434 140 140 141 141 b = ds.GetRasterBand(1) 142 if b.GetNoDataValue() != -99999 .123:142 if b.GetNoDataValue() != -99999: 143 143 gdaltest.post_reason( 'Grid NODATA value wrong or missing.' ) 144 144 return 'fail' branches/1.5/autotest/gdrivers/data/nodata_float.asc
r13407 r13434 4 4 yllcorner 3750120.000000000000 5 5 cellsize 60.000000000000 6 nodata_value -99999 .1236 nodata_value -99999 7 7 107 123 132 115 132 8 8 115 132 107 123 148 branches/1.5/gdal/frmts/aaigrid/aaigriddataset.cpp
r13407 r13434 30 30 #include "gdal_pam.h" 31 31 #include <ctype.h> 32 #include <limits.h> 32 33 #include "cpl_string.h" 33 34 #include "ogr_spatialref.h" … … 380 381 char **papszTokens = NULL; 381 382 GDALDataType eDataType = GDT_Int16; 382 GDALDataType eNoDataType = GDT_Int16;383 383 384 384 /* -------------------------------------------------------------------- */ … … 483 483 poDS->bNoDataSet = TRUE; 484 484 poDS->dfNoDataValue = atof(pszNoData); 485 486 if( strchr(pszNoData, '.' ) != NULL )487 eNoDataType = GDT_Float32;488 485 } 489 486 … … 535 532 CPLAssert( NULL != poDS->fp ); 536 533 537 /* Use type of nodata value. */ 538 if( poDS->bNoDataSet && eNoDataType == GDT_Float32 ) 534 /* Use bigger data type. */ 535 if( poDS->bNoDataSet 536 && ( SHRT_MIN > poDS->dfNoDataValue || poDS->dfNoDataValue > SHRT_MAX) ) 539 537 { 540 538 eDataType = GDT_Float32;
