DEM File Packer
A Program that Packs DEM Files Into a Single Humongous Binary File
 All Files Functions Variables Pages
Functions | Variables
main.cpp File Reference

Main. More...

#include <stdio.h>
#include "defines.h"

Functions

int GetTime ()
 Get time.
 
bool ReadHeightData (int row, int col, char *filename)
 Read height data.
 
int main (int argc, char *argv[])
 Main.
 

Variables

char filenamefilename [] = "filelist20x20.txt"
 Name of a file that contains a list of file names.
 
const int GRIDSIZE = 20
 Number of DEM files on one side of square grid.
 
const int CELLSIZE = 4000
 Number of points on one side of a DEM file.
 
const int ARRAYSIZE = CELLSIZE*GRIDSIZE
 Number of points on one side of the whole array of heights.
 
long long g_nPointCount = 0LL
 Number of points processed.
 
long long g_nBadPointCount = 0LL
 Number of points with bad data processed.
 
unsigned short ** g_nHeight
 Buffer for packed height data.
 

Function Documentation

int GetTime ( )

Get the current time in milliseconds.

Returns
Time in ms.
int main ( int  argc,
char *  argv[] 
)

Does initialization, allocates memory, reads the list of file names, reads those files into the height buffer g_pHeight, saves the height buffer into UtahDEMData.bin, deallocates the memory and shuts down.

Parameters
argcArgument count
argvArguments.
Returns
0 for success, 1 for failure.
bool ReadHeightData ( int  row,
int  col,
char *  filename 
)

Read the height data from a single DEM file and put it into the correct place in g_pHeight, which it assumes points to a buffer of the right size.

Parameters
rowY coordinate of cell.
colX coordinate of cell.
filenameName of DEM file to be read.
Returns
true if it succeeds, false if it fails