Changeset 14478
- Timestamp:
- 05/16/08 16:34:08 (2 months ago)
- Files:
-
- trunk/gdal/frmts/aaigrid/aaigriddataset.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/frmts/aaigrid/aaigriddataset.cpp
r14476 r14478 223 223 ((float *) pImage)[iPixel] = (float) atof(szToken); 224 224 else 225 ((GInt 16 *) pImage)[iPixel] = (GInt16) atoi(szToken);225 ((GInt32 *) pImage)[iPixel] = (GInt32) atoi(szToken); 226 226 } 227 227 … … 380 380 int j = 0; 381 381 char **papszTokens = NULL; 382 GDALDataType eDataType = GDT_Int16; 382 383 /* Default data type */ 384 GDALDataType eDataType = GDT_Int32; 383 385 384 386 /* -------------------------------------------------------------------- */ … … 483 485 poDS->bNoDataSet = TRUE; 484 486 poDS->dfNoDataValue = atof(pszNoData); 487 if( strchr( pszNoData, '.' ) != NULL ) 488 { 489 eDataType = GDT_Float32; 490 } 485 491 } 486 492 … … 534 540 /* Use bigger data type. */ 535 541 if( poDS->bNoDataSet 536 && ( SHRT_MIN > poDS->dfNoDataValue || poDS->dfNoDataValue > SHRT_MAX) )542 && ( INT_MIN > poDS->dfNoDataValue || poDS->dfNoDataValue > INT_MAX) ) 537 543 { 538 544 eDataType = GDT_Float32; … … 540 546 else 541 547 { 542 /* Default value type. */543 eDataType = GDT_Int16;544 545 548 /* Allocate 100K chunk + 1 extra byte for NULL character. */ 546 549 const size_t nChunkSize = 1024 * 100; … … 944 947 poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "asc" ); 945 948 poDriver->SetMetadataItem( GDAL_DMD_CREATIONDATATYPES, 946 "Byte UInt16 Int16 Float32" );949 "Byte UInt16 Int16 Int32 Float32" ); 947 950 948 951 poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
