2.94 - Reduced MAXPAGES for LIDAR to allow large Cali tiles

This commit is contained in:
alex
2016-10-03 22:24:23 +01:00
parent cc7c64e198
commit a73e0e3a6e
2 changed files with 24 additions and 18 deletions

View File

@@ -220,7 +220,7 @@ int loadLIDAR(char *filenames)
double xll, yll, xur, yur, cellsize, avgCellsize; double xll, yll, xur, yur, cellsize, avgCellsize;
char found, free_page = 0, jline[20], lid_file[255], char found, free_page = 0, jline[20], lid_file[255],
path_plus_name[255], *junk = NULL; path_plus_name[255], *junk = NULL;
char line[50000]; char line[100000];
char * pch; char * pch;
double TO_DEG = (180 / PI); double TO_DEG = (180 / PI);
FILE *fd; FILE *fd;
@@ -248,17 +248,21 @@ int loadLIDAR(char *filenames)
fflush(stdout); fflush(stdout);
} }
if (fgets(line, 255, fd) != NULL)
height = atoi(pch); // nrows
if (!dem_alloced) { if (!dem_alloced) {
IPPD = width * 1.1; // +10% if(width>height){
IPPD = width;
}else{
IPPD = height;
}
ARRAYSIZE = (MAXPAGES * IPPD) + 10; ARRAYSIZE = (MAXPAGES * IPPD) + 10;
do_allocs(); do_allocs();
dem_alloced = 1; dem_alloced = 1;
} }
} }
if (fgets(line, 255, fd) != NULL)
height = atoi(pch); // nrows
if (fgets(line, 255, fd) != NULL) { if (fgets(line, 255, fd) != NULL) {
sscanf(pch, "%lf", &xll); // xll sscanf(pch, "%lf", &xll); // xll
} }
@@ -282,7 +286,7 @@ int loadLIDAR(char *filenames)
xur = xll+(cellsize*width); xur = xll+(cellsize*width);
yur = yll+(cellsize*height); yur = yll+(cellsize*height);
//} //}
if (xur > eastoffset) if (xur > eastoffset)
eastoffset = xur; eastoffset = xur;
if (xll < westoffset) if (xll < westoffset)
@@ -293,15 +297,15 @@ int loadLIDAR(char *filenames)
// Greenwich straddling hack // Greenwich straddling hack
if (xll < 0 && xur > 0) { if (xll <= 0 && xur > 0) {
xll = (xur - xll); // full width xll = (xur - xll); // full width
xur = 0.0; // budge it along so it's west of greenwich xur = 0.0; // budge it along so it's west of greenwich
delta = eastoffset; // add to Tx longitude later delta = eastoffset; // add to Tx longitude later
} else { } else {
// Transform WGS84 longitudes into 'west' values as society finishes east of Greenwich ;) // Transform WGS84 longitudes into 'west' values as society finishes east of Greenwich ;)
if (xll > 0) if (xll >= 0)
xll = 360-xll; xll = 360-xll;
if(xur > 0) if(xur >= 0)
xur = 360-xur; xur = 360-xur;
if(xll < 0) if(xll < 0)
xll = xll * -1; xll = xll * -1;
@@ -329,11 +333,8 @@ int loadLIDAR(char *filenames)
} }
indx++; indx++;
} // filename(s) } // filename(s)
// TESTING!
IPPD=width; IPPD=width;
ippd=width; ippd=IPPD;
//avgCellsize=avgCellsize/fc;
height = (unsigned)((max_north-min_north) / cellsize); height = (unsigned)((max_north-min_north) / cellsize);
width = (unsigned)((max_west-min_west) / cellsize); width = (unsigned)((max_west-min_west) / cellsize);

15
main.cc
View File

@@ -1,4 +1,4 @@
double version = 2.93; double version = 2.94;
/****************************************************************************\ /****************************************************************************\
* Signal Server: Radio propagation simulator by Alex Farrant QCVS, 2E0TDW * * Signal Server: Radio propagation simulator by Alex Farrant QCVS, 2E0TDW *
****************************************************************************** ******************************************************************************
@@ -530,6 +530,9 @@ void ReadPath(struct site source, struct site destination)
tempsite.lat = lat2; tempsite.lat = lat2;
tempsite.lon = lon2; tempsite.lon = lon2;
path.elevation[c] = GetElevation(tempsite); path.elevation[c] = GetElevation(tempsite);
// fix for tile gaps in multi-tile LIDAR plots
if(path.elevation[c]==0 && path.elevation[c-1] > 10)
path.elevation[c]=path.elevation[c-1];
path.distance[c] = distance; path.distance[c] = distance;
} }
@@ -1036,9 +1039,9 @@ int main(int argc, char *argv[])
} }
if (strstr(argv[0], "signalserverLIDAR")) { if (strstr(argv[0], "signalserverLIDAR")) {
MAXPAGES = 100; // 10x10 MAXPAGES = 64; // 8x8
lidar = 1; lidar = 1;
IPPD = 500; // will be overridden based upon file header... IPPD = 5000; // will be overridden based upon file header...
} }
strncpy(ss_name, "Signal Server\0", 14); strncpy(ss_name, "Signal Server\0", 14);
@@ -1612,7 +1615,7 @@ int main(int argc, char *argv[])
err = loadLIDAR(lidar_tiles); err = loadLIDAR(lidar_tiles);
if (err) { if (err) {
fprintf(stdout, "Couldn't find one or more of the " fprintf(stdout, "Couldn't find one or more of the "
"lidar files. Please ensure their paths are\n" "lidar files. Please ensure their paths are "
"correct and try again.\n"); "correct and try again.\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -1751,7 +1754,9 @@ int main(int argc, char *argv[])
PlotPropagation(tx_site[0], altitudeLR, ano_filename, PlotPropagation(tx_site[0], altitudeLR, ano_filename,
propmodel, knifeedge, haf, pmenv, use_threads); propmodel, knifeedge, haf, pmenv, use_threads);
if(debug)
fprintf(stdout,"Finished PlotPropagation()\n");
if(!lidar){ if(!lidar){
if (LR.erp == 0.0) if (LR.erp == 0.0)
hottest=9; // 9dB nearfield hottest=9; // 9dB nearfield