Skip to content

Commit 08a2e33

Browse files
committed
Merge pull request #52 from dtarb/49-correct-bigtiff-support
49 correct bigtiff support
2 parents 268d8a3 + 56bd56a commit 08a2e33

File tree

4 files changed

+36
-20
lines changed

4 files changed

+36
-20
lines changed

Taudem5PCVS2010/TauDEM.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 5,3,3,0
55-
PRODUCTVERSION 5,3,3,0
54+
FILEVERSION 5,3,4,0
55+
PRODUCTVERSION 5,3,4,0
5656
FILEFLAGSMASK 0x17L
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -68,11 +68,11 @@ BEGIN
6868
BLOCK "040904b0"
6969
BEGIN
7070
VALUE "FileDescription", "TauDEM Application"
71-
VALUE "FileVersion", "5.3.3.0"
71+
VALUE "FileVersion", "5.3.4.0"
7272
VALUE "InternalName", "TauDEM 5"
7373
VALUE "LegalCopyright", "Copyright (C) 2016 GPL V3"
7474
VALUE "ProductName", "TauDEM"
75-
VALUE "ProductVersion", "5.3.3.0"
75+
VALUE "ProductVersion", "5.3.4.0"
7676
END
7777
END
7878
BLOCK "VarFileInfo"

WindowsInstaller/setup.iss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
; TauDEMArcGIS/
2525

2626
#define MyAppName "TauDEM"
27-
#define MyAppVersion "5.3.3"
27+
#define MyAppVersion "5.3.4"
2828
#define MyAppPublisher "Utah State University"
2929
#define MyAppURL "http://hydrology.usu.edu/taudem/taudem5/index.html"
3030

@@ -136,14 +136,14 @@ begin
136136
begin
137137
UserPage := CreateInputQueryPage(wpWelcome,
138138
'The following programs will be installed', '',
139-
'TauDEM version 5.3.3, GDAL 1.9.2 (Python 2.7), GDAL 111 (MSVC 2010) for 64 bit Winodws PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
139+
'TauDEM version 5.3.4, GDAL 1.9.2 (Python 2.7), GDAL 111 (MSVC 2010) for 64 bit Winodws PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
140140
'Microsoft Visual C++ 2010 SP1 Redistributable Package (x64), Microsoft HPC Pack 2012 MS-MPI Redistributable Package'#13#13 + notes_string);
141141
end
142142
else
143143
begin
144144
UserPage := CreateInputQueryPage(wpWelcome,
145145
'The following programs will be installed', '',
146-
'TauDEM version 5.3.3, GDAL 1.9.2 (Python 2.7), GDAL 111 (MSVC 2010) for 32 bit Windows PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
146+
'TauDEM version 5.3.4, GDAL 1.9.2 (Python 2.7), GDAL 111 (MSVC 2010) for 32 bit Windows PC, Microsoft Visual C++ 2010 SP1 Redistributable Package (x86), ' +
147147
'Microsoft HPC Pack 2012 MS-MPI Redistributable Package'#13#13 + notes_string);
148148
end
149149
end;

src/commonLib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ email: [email protected]
5959
#define NOTFINISHED 0
6060
#define FINISHED 1
6161

62-
#define TDVERSION "5.3.3"
62+
#define TDVERSION "5.3.4"
6363

6464
enum DATA_TYPE
6565
{ SHORT_TYPE,

src/tiffIO.cpp

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ void tiffIO::write(long xstart, long ystart, long numRows, long numCols, void* s
251251
fflush(stdout);
252252
char **papszMetadata;
253253
char **papszOptions = NULL;
254-
const char *extension_list[5] = {".tif",".img",".sdat",".bil",".bin"}; // extension list --can add more
255-
const char *driver_code[5] = {"GTiff","HFA","SAGA","EHdr","ENVI"}; // code list -- can add more
256-
const char *compression_meth[5] = {"LZW","RLE"," "," "," "}; // code list -- can add more
257-
size_t extension_num=5;
254+
const char *extension_list[6] = {".tif",".img",".sdat",".bil",".bin",".tiff"}; // extension list --can add more
255+
const char *driver_code[6] = {"GTiff","HFA","SAGA","EHdr","ENVI","GTiff"}; // code list -- can add more
256+
const char *compression_meth[6] = {"LZW","YES"," "," "," "," "}; // code list -- can add more
257+
size_t extension_num=6;
258258
char *ext;
259259
int index = -1;
260260

@@ -293,20 +293,36 @@ void tiffIO::write(long xstart, long ystart, long numRows, long numCols, void* s
293293
if (rank == 0) {
294294
//if (isFileInititialized == 0) {
295295
hDriver = GDALGetDriverByName(driver_code[index]);
296-
papszOptions = CSLSetNameValue( papszOptions, "COMPRESS", compression_meth[index]); //
297-
298296
if (hDriver == NULL) {
299297
printf("driver is not available\n");
300298
MPI_Abort(MPI_COMM_WORLD, 22);
301299
}
300+
// Set options
301+
if(index==0){ // for .tif files. Refer to http://www.gdal.org/frmt_gtiff.html for GTiff options.
302+
papszOptions = CSLSetNameValue( papszOptions, "COMPRESS", compression_meth[index]);
303+
}
304+
else if(index==1){ // .img files. Refer to http://www.gdal.org/frmt_hfa.html where COMPRESSED = YES are create options for ERDAS .img files
305+
papszOptions = CSLSetNameValue( papszOptions, "COMPRESSED", compression_meth[index]);
306+
}
307+
int cellbytes=4;
308+
if (datatype == SHORT_TYPE)cellbytes=2;
309+
double fileGB=(double)cellbytes*(double)totalX*(double)totalY/1000000000.0; // This purposely neglects the lower significant digits to overvalue GB to allow space for header information in the file
310+
if(fileGB > 4.0){
311+
if(index==0 || index==6){ // .tiff files. Need to explicity indicate BIGTIFF. See http://www.gdal.org/frmt_gtiff.html.
312+
papszOptions = CSLSetNameValue( papszOptions, "BIGTIFF", "YES");
313+
printf("Setting BIGTIFF, File: %s, Anticipated size (GB):%.2f\n", filename,fileGB);
314+
}
315+
}
302316

303317
GDALDataType eBDataType;
304-
if (datatype == FLOAT_TYPE)
305-
eBDataType = GDT_Float32;
306-
else if (datatype == SHORT_TYPE)
307-
eBDataType = GDT_Int16;
308-
else if (datatype == LONG_TYPE)
309-
eBDataType = GDT_Int32;
318+
if (datatype == FLOAT_TYPE)
319+
eBDataType = GDT_Float32;
320+
else if (datatype == SHORT_TYPE)
321+
{
322+
eBDataType = GDT_Int16;
323+
}
324+
else if (datatype == LONG_TYPE)
325+
eBDataType = GDT_Int32;
310326

311327

312328
fh = GDALCreate(hDriver, filename, totalX , totalY, 1, eBDataType, papszOptions);

0 commit comments

Comments
 (0)