Changeset 13704
- Timestamp:
- 02/06/08 06:56:39 (5 months ago)
- Files:
-
- trunk/gdal/frmts/srtmhgt/srtmhgtdataset.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/frmts/srtmhgt/srtmhgtdataset.cpp
r13687 r13704 31 31 ****************************************************************************/ 32 32 33 #include <stdio.h>34 #include <stdlib.h>35 #include <string.h>36 33 #include "gdal_pam.h" 37 34 #include "cpl_port.h" … … 42 39 43 40 CPL_CVSID("$Id: srtmhgtdataset.cpp $"); 41 44 42 CPL_C_START 45 43 void GDALRegister_SRTMHGT(void); … … 87 85 friend class SRTMHGTDataset; 88 86 89 int bNoDataSet;87 int bNoDataSet; 90 88 double dfNoDataValue; 91 89 … … 122 120 /************************************************************************/ 123 121 124 CPLErr SRTMHGTRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, void* pImage) 122 CPLErr SRTMHGTRasterBand::IReadBlock(int nBlockXOff, int nBlockYOff, 123 void* pImage) 125 124 { 126 125 SRTMHGTDataset* poGDS = (SRTMHGTDataset*) poDS; … … 129 128 if(nBlockXOff != 0) 130 129 { 131 CPLError(CE_Failure, CPLE_NotSupported, "unhandled nBlockXOff value : %d", nBlockXOff); 130 CPLError(CE_Failure, CPLE_NotSupported, 131 "unhandled nBlockXOff value : %d", nBlockXOff); 132 132 return CE_Failure; 133 133 } … … 137 137 138 138 /* -------------------------------------------------------------------- */ 139 /* Load the desired data into the working buffer. */139 /* Load the desired data into the working buffer. */ 140 140 /* -------------------------------------------------------------------- */ 141 141 VSIFSeekL(poGDS->fpImage, nBlockYOff*nBlockXSize*2, SEEK_SET); … … 270 270 271 271 /* -------------------------------------------------------------------- */ 272 /* We check the file size to see if it is 25,934,402 bytes */272 /* We check the file size to see if it is 25,934,402 bytes */ 273 273 /* (SRTM 1) or 2,884,802 bytes (SRTM 3) */ 274 274 /* -------------------------------------------------------------------- */ 275 275 VSIStatBufL fileStat; 276 276 277 if(VSIStatL(poOpenInfo->pszFilename, &fileStat) != 0) 277 278 return FALSE; … … 461 462 /* -------------------------------------------------------------------- */ 462 463 char expectedFileName[12]; 463 sprintf(expectedFileName, "%c%02d%c%03d.HGT", 464 (nLLOriginLat >= 0) ? 'N' : 'S', (nLLOriginLat >= 0) ? nLLOriginLat : -nLLOriginLat, 465 (nLLOriginLong >= 0) ? 'E' : 'W', (nLLOriginLong >= 0) ? nLLOriginLong : -nLLOriginLong); 464 snprintf(expectedFileName, sizeof(expectedFileName), "%c%02d%c%03d.HGT", 465 (nLLOriginLat >= 0) ? 'N' : 'S', 466 (nLLOriginLat >= 0) ? nLLOriginLat : -nLLOriginLat, 467 (nLLOriginLong >= 0) ? 'E' : 'W', 468 (nLLOriginLong >= 0) ? nLLOriginLong : -nLLOriginLong); 466 469 if (!EQUAL(expectedFileName, CPLGetFilename(pszFilename))) 467 470 {
