diff --git a/inputs.cc b/inputs.cc index a59d8f5..4189176 100644 --- a/inputs.cc +++ b/inputs.cc @@ -220,7 +220,7 @@ int loadLIDAR(char *filenames) double xll, yll, xur, yur, cellsize, avgCellsize; char found, free_page = 0, jline[20], lid_file[255], path_plus_name[255], *junk = NULL; - char line[50000]; + char line[100000]; char * pch; double TO_DEG = (180 / PI); FILE *fd; @@ -248,17 +248,21 @@ int loadLIDAR(char *filenames) fflush(stdout); } + if (fgets(line, 255, fd) != NULL) + height = atoi(pch); // nrows + if (!dem_alloced) { - IPPD = width * 1.1; // +10% + if(width>height){ + IPPD = width; + }else{ + IPPD = height; + } ARRAYSIZE = (MAXPAGES * IPPD) + 10; do_allocs(); dem_alloced = 1; } } - if (fgets(line, 255, fd) != NULL) - height = atoi(pch); // nrows - if (fgets(line, 255, fd) != NULL) { sscanf(pch, "%lf", &xll); // xll } @@ -282,7 +286,7 @@ int loadLIDAR(char *filenames) xur = xll+(cellsize*width); yur = yll+(cellsize*height); //} - + if (xur > eastoffset) eastoffset = xur; if (xll < westoffset) @@ -293,15 +297,15 @@ int loadLIDAR(char *filenames) // Greenwich straddling hack - if (xll < 0 && xur > 0) { + if (xll <= 0 && xur > 0) { xll = (xur - xll); // full width xur = 0.0; // budge it along so it's west of greenwich delta = eastoffset; // add to Tx longitude later } else { // Transform WGS84 longitudes into 'west' values as society finishes east of Greenwich ;) - if (xll > 0) + if (xll >= 0) xll = 360-xll; - if(xur > 0) + if(xur >= 0) xur = 360-xur; if(xll < 0) xll = xll * -1; @@ -329,11 +333,8 @@ int loadLIDAR(char *filenames) } indx++; } // filename(s) - - // TESTING! IPPD=width; - ippd=width; - //avgCellsize=avgCellsize/fc; + ippd=IPPD; height = (unsigned)((max_north-min_north) / cellsize); width = (unsigned)((max_west-min_west) / cellsize); diff --git a/main.cc b/main.cc index 8850600..4f3eb56 100644 --- a/main.cc +++ b/main.cc @@ -1,4 +1,4 @@ -double version = 2.93; +double version = 2.94; /****************************************************************************\ * 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.lon = lon2; 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; } @@ -1036,9 +1039,9 @@ int main(int argc, char *argv[]) } if (strstr(argv[0], "signalserverLIDAR")) { - MAXPAGES = 100; // 10x10 + MAXPAGES = 64; // 8x8 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); @@ -1612,7 +1615,7 @@ int main(int argc, char *argv[]) err = loadLIDAR(lidar_tiles); if (err) { 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"); exit(EXIT_FAILURE); } @@ -1751,7 +1754,9 @@ int main(int argc, char *argv[]) PlotPropagation(tx_site[0], altitudeLR, ano_filename, propmodel, knifeedge, haf, pmenv, use_threads); - + if(debug) + fprintf(stdout,"Finished PlotPropagation()\n"); + if(!lidar){ if (LR.erp == 0.0) hottest=9; // 9dB nearfield