forked from ExternalVendorCode/Signal-Server
2.8 LIDAR improvements
This commit is contained in:
BIN
1200.h.gch
BIN
1200.h.gch
Binary file not shown.
BIN
3600.h.gch
BIN
3600.h.gch
Binary file not shown.
@@ -1,5 +1,11 @@
|
|||||||
SIGNAL SERVER CHANGELOG
|
SIGNAL SERVER CHANGELOG
|
||||||
|
|
||||||
|
2.8 - 08 June 2016
|
||||||
|
Widened scope of LIDAR / ASCII Grid input to include sub-meter accurate tiles. (ac000)
|
||||||
|
Optimised memory usage (ac000)
|
||||||
|
Tidied and refactored some code (ac000)
|
||||||
|
Updated Readme and callsign because I passed my intermediate :)
|
||||||
|
|
||||||
2.75 - 22 Apr 2016
|
2.75 - 22 Apr 2016
|
||||||
Added Hata model logic for f < 200MHz
|
Added Hata model logic for f < 200MHz
|
||||||
|
|
||||||
|
112
README.md
112
README.md
@@ -1,12 +1,12 @@
|
|||||||
# Signal Server
|
# Signal Server
|
||||||
Server optimised SPLAT! by Alex Farrant, M6ZUJ.
|
Multi-threaded radio propagation simulator based upon SPLAT! by Alex Farrant QCVS, 2E0TDW.
|
||||||
|
|
||||||
SPLAT! Project started in 1997 by John A. Magliacane, KD2BD
|
SPLAT! Project started in 1997 by John A. Magliacane, KD2BD
|
||||||
|
|
||||||
This server application will generate RF coverage predictions, producing either 2D profile plots (Point-to-Point) or 360 degree polar plots in WGS-84 projection.
|
This server application will generate RF coverage predictions, producing either 2D profile plots (Point-to-Point) or 360 degree polar plots in WGS-84 projection as PPM Bitmaps.
|
||||||
For detailed information and historical reference data related to this project see the SPLAT! documentation. Propagation models added to this project have been sourced from reputable academic sources and all efforts have been taken to ensure their accurate implementation. Not all models are ITU ratified and you use them entirely at your own risk.
|
For detailed information and historical reference data related to this project see the SPLAT! documentation. Propagation models added to this project have been sourced from reputable academic sources and all efforts have been taken to ensure their accurate implementation. Not all models are ITU ratified and you use them entirely at your own risk.
|
||||||
|
|
||||||
The accuracy of the output is directly proportional to the accuracy of the inputs and the time taken defining and validating them.
|
WARNING: The accuracy of the output is directly proportional to the accuracy of the inputs and the time taken defining and validating them.
|
||||||
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@@ -14,7 +14,7 @@ The accuracy of the output is directly proportional to the accuracy of the input
|
|||||||
* GCC,G++
|
* GCC,G++
|
||||||
* Multicore CPU (optional)
|
* Multicore CPU (optional)
|
||||||
* ~2GB Memory
|
* ~2GB Memory
|
||||||
* SRTM terrain tiles
|
* SRTM terrain tile(s) or ASCII Grid tile(s)
|
||||||
|
|
||||||
Signal Server is a very resource intensive multicore application. Only publish it for common use if you know what you are doing and you are advised to wrap it with another script to perform input validation.
|
Signal Server is a very resource intensive multicore application. Only publish it for common use if you know what you are doing and you are advised to wrap it with another script to perform input validation.
|
||||||
|
|
||||||
@@ -25,11 +25,16 @@ Additional programs/scripts will be required to prepare inputs such as .sdf tile
|
|||||||
$ make
|
$ make
|
||||||
```
|
```
|
||||||
## Parameters
|
## Parameters
|
||||||
-- Signal Server 2.72 --
|
```
|
||||||
|
---| Signal Server 2.80 |---
|
||||||
|
RF propagation simulator by Alex Farrant, 2E0TDW
|
||||||
Set for 64 tiles at 1200 pixels/degree
|
Set for 64 tiles at 1200 pixels/degree
|
||||||
|
|
||||||
-sdf Directory containing .sdf tiles
|
REFERENCE DATA
|
||||||
-lid LIDAR ASCII tile with WGS84 bounds (Dimensions defined in file metadata)
|
-sdf Directory containing SRTM derived .sdf tiles
|
||||||
|
-lid WGS84 ASCII grid tile (LIDAR) with dimensions and resolution defined in header
|
||||||
|
-udt User defined CSV clutter file
|
||||||
|
INPUT
|
||||||
-lat Tx Latitude (decimal degrees) -70/+70
|
-lat Tx Latitude (decimal degrees) -70/+70
|
||||||
-lon Tx Longitude (decimal degrees) -180/+180
|
-lon Tx Longitude (decimal degrees) -180/+180
|
||||||
-txh Tx Height (above ground)
|
-txh Tx Height (above ground)
|
||||||
@@ -38,42 +43,109 @@ $ make
|
|||||||
-f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)
|
-f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)
|
||||||
-erp Tx Effective Radiated Power (Watts)
|
-erp Tx Effective Radiated Power (Watts)
|
||||||
-rxh Rx Height(s) (optional. Default=0.1)
|
-rxh Rx Height(s) (optional. Default=0.1)
|
||||||
-rt Rx Threshold (dB / dBm / dBuV/m)
|
|
||||||
-hp Horizontal Polarisation (default=vertical)
|
-hp Horizontal Polarisation (default=vertical)
|
||||||
-gc Ground clutter (feet/meters)
|
-gc Ground clutter (feet/meters)
|
||||||
-udt User defined terrain filename
|
|
||||||
-dbm Plot Rxd signal power instead of field strength
|
|
||||||
-m Metric units of measurement
|
-m Metric units of measurement
|
||||||
-te Terrain code 1-6 (optional)
|
-te Terrain code 1-6 (optional)
|
||||||
-terdic Terrain dielectric value 2-80 (optional)
|
-terdic Terrain dielectric value 2-80 (optional)
|
||||||
-tercon Terrain conductivity 0.01-0.0001 (optional)
|
-tercon Terrain conductivity 0.01-0.0001 (optional)
|
||||||
-cl Climate code 1-6 (optional)
|
-cl Climate code 1-6 (optional)
|
||||||
|
OUTPUT
|
||||||
|
-dbm Plot Rxd signal power instead of field strength
|
||||||
|
-rt Rx Threshold (dB / dBm / dBuV/m)
|
||||||
-o Filename. Required.
|
-o Filename. Required.
|
||||||
-R Radius (miles/kilometers)
|
-R Radius (miles/kilometers)
|
||||||
-res Pixels per tile. 300/600/1200/3600 (Optional. LIDAR res is defined within the tile)
|
-res Pixels per tile. 300/600/1200/3600 (Optional. LIDAR res is defined within the tile)
|
||||||
-t Terrain background
|
-pm Propagation model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,
|
||||||
-pm Prop model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,
|
5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson
|
||||||
5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson
|
-pe Propagation model mode: 1=Urban,2=Suburban,3=Rural
|
||||||
-pe Prop model mode: 1=Urban,2=Suburban,3=Rural
|
-ked Knife edge diffraction (Already on for ITM)
|
||||||
-ked Knife edge diffraction (Default for ITM)
|
DEBUGGING
|
||||||
|
-t Terrain greyscale background
|
||||||
|
-dbg Verbose debug messages
|
||||||
-ng Normalise Path Profile graph
|
-ng Normalise Path Profile graph
|
||||||
-haf Halve 1 or 2 (optional)
|
-haf Halve 1 or 2 (optional)
|
||||||
-nothreads Turn off threaded processing (optional)
|
-nothreads Turn off threaded processing
|
||||||
|
```
|
||||||
|
|
||||||
|
### REFERENCE DATA
|
||||||
|
Signal server is designed for most of the environments and climates on Planet Earth but Polar region support is limited above extreme latitudes. (Svalbard is ok).
|
||||||
|
It can run with or without terrain data and can even be used to simulate radiation of other EM emissions like light.
|
||||||
|
|
||||||
|
#### -sdf
|
||||||
|
##### Directory containing Digital Elevation Models (DEM)
|
||||||
|
SDF formatted tiles can be created by converting SRTM tiles (30m or 90m) in HGT format with the [srtm2sdf.c](https://www.google.co.uk/search?q=srtm2sdf.c) utility from SPLAT!. At the time of writing these tiles can be obtained for free from the [USGS website](https://dds.cr.usgs.gov/srtm/).
|
||||||
|
|
||||||
|
|
||||||
|
#### -lid
|
||||||
|
##### WGS84 ASCII grid tile (LIDAR) with dimensions and resolution defined in header
|
||||||
|
LIDAR data can be used providing it is in ASCII grid format with WGS84 projection. Super tiles with up to 10000 rows by 10000 cols have been tested. Unlike a normal ASCII Grid file, this expects additional box bounds to be defined in the header as follows with this example for a 50.41km square tile. Cellsize should be in meters and co-ordinates must be in WGS84 decimal degrees.
|
||||||
|
```
|
||||||
|
ncols 5041
|
||||||
|
nrows 5041
|
||||||
|
xllcorner 6.44681098949985
|
||||||
|
yllcorner 58.1638386261566
|
||||||
|
xurcorner 7.28124500979768
|
||||||
|
yurcorner 58.6306585538797
|
||||||
|
cellsize 10
|
||||||
|
NODATA_value 0
|
||||||
|
```
|
||||||
|
|
||||||
|
#### -udt
|
||||||
|
##### User defined CSV clutter file
|
||||||
|
This text file allows you to define buildings with co-ordinates and heights.
|
||||||
|
Elevations in the UDT file are evaluated and then copied into a temporary file under /tmp. Then the contents of the temp file are scanned, and if found to be unique,
|
||||||
|
are added to the ground elevations described by the digital elevation data in memory. Height units are determined by appending M for meters or nothing for feet.
|
||||||
|
Format: latitude,longitude,height
|
||||||
|
```
|
||||||
|
54.555,-2.221,10M
|
||||||
|
54.555,-2.222,10M
|
||||||
|
54.555,-2.223,10M
|
||||||
|
```
|
||||||
|
|
||||||
|
### Antenna radiation pattern(s)
|
||||||
|
Antenna pattern data is read from a pair of files having the same base name as the output file (-o), but with .az and .el extensions for azimuth and elevation patterns.
|
||||||
|
```
|
||||||
|
045.0
|
||||||
|
0 0.8950590
|
||||||
|
1 0.8966406
|
||||||
|
2 0.8981447
|
||||||
|
3 0.8995795
|
||||||
|
4 0.9009535
|
||||||
|
5 0.9022749
|
||||||
|
```
|
||||||
|
The first line of the .az file specifies the direction measured clockwise in degrees from True North. This is followed by azimuth headings (0 to 360 degrees) and their associated normalized field patterns (0.000 to 1.000) separated by whitespace.
|
||||||
|
|
||||||
|
The structure of SPLAT! elevation pattern files is slightly different. The first line of the .el file specifies the amount of mechanical beamtilt applied to the antenna. A downward tilt is expressed as a positive angle, while an upward tilt is expressed as a negative angle. This data is followed by the azimuthal direction of the tilt, separated by whitespace.
|
||||||
|
The remainder of the file consists of elevation angles and their radiation pattern (0.000 to 1.000) values separated by whitespace. Elevation angles must be specified over a -10.0 to +90.0 degree range. In this example, the antenna is tilted down 2
|
||||||
|
degrees towards an azimuth of 045.0 degrees.
|
||||||
|
```
|
||||||
|
2.0 045.0
|
||||||
|
-10.0 0.172
|
||||||
|
-9.5 0.109
|
||||||
|
-9.0 0.115
|
||||||
|
-8.5 0.155
|
||||||
|
-8.0 0.157
|
||||||
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### 90m resolution
|
### 90m resolution
|
||||||
- INPUTS: 900MHz tower at 25m AGL with 5W ERP, 30km radius
|
- INPUTS: 900MHz tower at 25m AGL with 5W ERP, 30km radius
|
||||||
- OUTPUTS: 1200 resolution, 30km radius, -90dBm receiver threshold, Longley Rice model
|
- OUTPUTS: 1200 resolution, 30km radius, -90dBm receiver threshold, Longley Rice model
|
||||||
- ./signalserver -sdf /data/SRTM3 -lat 51.849 -lon -2.2299 -txh 25 -f 900 -erp 5 -rxh 2 -rt -90 -dbm -m -o test1 -R 30 -res 1200 -pm 1
|
```
|
||||||
|
./signalserver -sdf /data/SRTM3 -lat 51.849 -lon -2.2299 -txh 25 -f 900 -erp 5 -rxh 2 -rt -90 -dbm -m -o test1 -R 30 -res 1200 -pm 1
|
||||||
|
```
|
||||||
### 30m resolution
|
### 30m resolution
|
||||||
- INPUTS: 450MHz tower at 25f AGL with 20W ERP, 10km radius
|
- INPUTS: 450MHz tower at 25f AGL with 20W ERP, 10km radius
|
||||||
- OUTPUTS: 3600 resolution, 30km radius, 10dBuV receiver threshold, Hata model
|
- OUTPUTS: 3600 resolution, 30km radius, 10dBuV receiver threshold, Hata model
|
||||||
- ./signalserverHD -sdf /data/SRTM1 -lat 51.849 -lon -2.2299 -txh 25 -f 450 -erp 20 -rxh 2 -rt 10 -o test2 -R 10 -res 3600 -pm 3
|
```
|
||||||
|
./signalserverHD -sdf /data/SRTM1 -lat 51.849 -lon -2.2299 -txh 25 -f 450 -erp 20 -rxh 2 -rt 10 -o test2 -R 10 -res 3600 -pm 3
|
||||||
|
```
|
||||||
|
|
||||||
### 2m resolution (LIDAR)
|
### 2m resolution (LIDAR)
|
||||||
- INPUTS: 1800MHz tower at 15m AGL with 1W ERP, 1 km radius
|
- INPUTS: 1800MHz tower at 15m AGL with 1W ERP, 1 km radius
|
||||||
- OUTPUTS: 2m LIDAR resolution, 5km radius, -90dBm receiver threshold, Longley Rice model
|
- OUTPUTS: 2m LIDAR resolution, 5km radius, -90dBm receiver threshold, Longley Rice model
|
||||||
- ./signalserverLIDAR -lid /data/LIDAR/Gloucester_2m.asc -lat 51.849 -lon -2.2299 -txh 15 -f 1800 -erp 1 -rxh 2 -rt -90 -dbm -m -o test3 -R 1 -pm 1
|
```
|
||||||
|
./signalserverLIDAR -lid /data/LIDAR/Gloucester_2m.asc -lat 51.849 -lon -2.2299 -txh 15 -f 1800 -erp 1 -rxh 2 -rt -90 -dbm -m -o test3 -R 1 -pm 1
|
||||||
|
```
|
||||||
|
360
inputs.cc
360
inputs.cc
@@ -6,29 +6,30 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "main.hh"
|
#include "main.hh"
|
||||||
|
|
||||||
void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx, double n, double e, double s, double west)
|
void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx,
|
||||||
|
double n, double e, double s, double west)
|
||||||
{
|
{
|
||||||
int x=0,y=0,reads=0;
|
int x = 0, y = 0, reads = 0;
|
||||||
char line[150000];
|
char line[150000];
|
||||||
char * pch;
|
char *pch;
|
||||||
|
|
||||||
// use offsets to determine middle lat/lon for 5 x 10k tiles
|
// use offsets to determine middle lat/lon for 5 x 10k tiles
|
||||||
// TALL
|
// TALL
|
||||||
if(voffset==0 && h==10000){
|
if (voffset == 0 && h == 10000) {
|
||||||
s = (s+n)/2;
|
s = (s+n)/2;
|
||||||
h=5000;
|
h = 5000;
|
||||||
}
|
}
|
||||||
if(voffset==5000 && h==10000){
|
if (voffset == 5000 && h == 10000) {
|
||||||
n = (s+n)/2;
|
n = (s+n)/2;
|
||||||
}
|
}
|
||||||
// WIDE
|
// WIDE
|
||||||
if(hoffset==0 && w==10000){
|
if (hoffset == 0 && w == 10000) {
|
||||||
e = (e+west)/2;
|
e = (e+west)/2;
|
||||||
w=5000;
|
w = 5000;
|
||||||
}
|
}
|
||||||
if(hoffset==5000 && w==10000){
|
if (hoffset == 5000 && w == 10000) {
|
||||||
west = (e+west)/2;
|
west = (e+west)/2;
|
||||||
w=5000;
|
w = 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
dem[indx].max_north=n;
|
dem[indx].max_north=n;
|
||||||
@@ -36,270 +37,271 @@ void readLIDAR(FILE *fd, int hoffset, int voffset, int h, int w, int indx, doubl
|
|||||||
dem[indx].min_north=s;
|
dem[indx].min_north=s;
|
||||||
dem[indx].max_west=west;
|
dem[indx].max_west=west;
|
||||||
|
|
||||||
|
|
||||||
if (dem[indx].max_west > max_west)
|
if (dem[indx].max_west > max_west)
|
||||||
max_west = dem[indx].max_west;
|
max_west = dem[indx].max_west;
|
||||||
if (dem[indx].min_west < min_west)
|
if (dem[indx].min_west < min_west)
|
||||||
min_west = dem[indx].min_west;
|
min_west = dem[indx].min_west;
|
||||||
|
|
||||||
if (max_west == -1)
|
if (max_west == -1) {
|
||||||
max_west = dem[indx].max_west;
|
max_west = dem[indx].max_west;
|
||||||
else {
|
} else {
|
||||||
if (abs(dem[indx].max_west - max_west) < 180) {
|
if (abs(dem[indx].max_west - max_west) < 180) {
|
||||||
if (dem[indx].max_west > max_west)
|
if (dem[indx].max_west > max_west)
|
||||||
max_west = dem[indx].max_west;
|
max_west = dem[indx].max_west;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
if (dem[indx].max_west < max_west)
|
if (dem[indx].max_west < max_west)
|
||||||
max_west = dem[indx].max_west;
|
max_west = dem[indx].max_west;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (min_west == 360)
|
if (min_west == 360) {
|
||||||
min_west = dem[indx].min_west;
|
min_west = dem[indx].min_west;
|
||||||
|
} else {
|
||||||
else {
|
|
||||||
if (fabs(dem[indx].min_west - min_west) < 180.0) {
|
if (fabs(dem[indx].min_west - min_west) < 180.0) {
|
||||||
if (dem[indx].min_west < min_west)
|
if (dem[indx].min_west < min_west)
|
||||||
min_west = dem[indx].min_west;
|
min_west = dem[indx].min_west;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
if (dem[indx].min_west > min_west)
|
if (dem[indx].min_west > min_west)
|
||||||
min_west = dem[indx].min_west;
|
min_west = dem[indx].min_west;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (y = h-1; y > -1; y--) {
|
for (y = h-1; y > -1; y--) {
|
||||||
x=w-1;
|
x = w-1;
|
||||||
if (fgets(line, 150000, fd) != NULL) {
|
if (fgets(line, 150000, fd) != NULL) {
|
||||||
// do nothing until n rows have passed
|
// do nothing until n rows have passed
|
||||||
if(y<voffset || voffset==0){
|
if (y < voffset || voffset == 0) {
|
||||||
pch = strtok (line, " ");
|
pch = strtok(line, " ");
|
||||||
|
|
||||||
//dummy reads until we reach offset
|
//dummy reads until we reach offset
|
||||||
// for 5000 offset, width must be 10e3
|
// for 5000 offset, width must be 10e3
|
||||||
for(n=0;n<hoffset;n++){
|
for (n = 0; n < hoffset; n++)
|
||||||
pch = strtok(NULL, " ");
|
pch = strtok(NULL, " ");
|
||||||
}
|
|
||||||
|
|
||||||
while(pch != NULL && x > -1){
|
while (pch != NULL && x > -1) {
|
||||||
if(atoi(pch)<-999){
|
if (atoi(pch) < -999)
|
||||||
pch="0";
|
pch = "0";
|
||||||
}
|
|
||||||
|
|
||||||
dem[indx].data[y][x]=atoi(pch);
|
|
||||||
dem[indx].signal[x][y] = 0;
|
|
||||||
dem[indx].mask[x][y] = 0;
|
|
||||||
if (atoi(pch) > dem[indx].max_el){
|
|
||||||
dem[indx].max_el = atoi(pch);
|
|
||||||
max_elevation = atoi(pch);
|
|
||||||
}
|
|
||||||
if (atoi(pch) < dem[indx].min_el){
|
|
||||||
dem[indx].min_el = atoi(pch);
|
|
||||||
min_elevation = dem[indx].min_el;
|
|
||||||
}
|
|
||||||
//}
|
|
||||||
|
|
||||||
x--;
|
|
||||||
pch = strtok (NULL, " ");
|
|
||||||
} //while
|
|
||||||
} //voffset
|
|
||||||
}else{
|
|
||||||
fprintf(stdout,"LIDAR error @ x %d y %d indx %d\n",x,y,indx);
|
|
||||||
}//if
|
|
||||||
}//for
|
|
||||||
|
|
||||||
|
dem[indx].data[y][x] = atoi(pch);
|
||||||
|
dem[indx].signal[x][y] = 0;
|
||||||
|
dem[indx].mask[x][y] = 0;
|
||||||
|
if (atoi(pch) > dem[indx].max_el) {
|
||||||
|
dem[indx].max_el = atoi(pch);
|
||||||
|
max_elevation = atoi(pch);
|
||||||
|
}
|
||||||
|
if (atoi(pch) < dem[indx].min_el) {
|
||||||
|
dem[indx].min_el = atoi(pch);
|
||||||
|
min_elevation = dem[indx].min_el;
|
||||||
|
}
|
||||||
|
x--;
|
||||||
|
pch = strtok(NULL, " ");
|
||||||
|
}//while
|
||||||
|
}//voffset
|
||||||
|
} else {
|
||||||
|
fprintf(stdout, "LIDAR error @ x %d y %d indx %d\n",
|
||||||
|
x, y, indx);
|
||||||
|
}//if
|
||||||
|
}//for
|
||||||
}
|
}
|
||||||
|
|
||||||
int loadLIDAR(char *filenames)
|
int loadLIDAR(char *filenames)
|
||||||
{
|
{
|
||||||
/* This function reads either 9 LIDAR tiles of n rows and n columns in ASCII grid format OR a single super tile composed of 2 or more tiles.
|
/*
|
||||||
The tile must have WGS84 bounds in the header in the order: WEST,SOUTH,EAST,NORTH
|
* This function reads either 9 LIDAR tiles of n rows and n columns
|
||||||
ncols 5000
|
* in ASCII grid format OR a single super tile composed of 2 or more
|
||||||
nrows 5000
|
* tiles. The tile must have WGS84 bounds in the header in the order:
|
||||||
xllcorner -2.291359
|
* WEST,SOUTH,EAST,NORTH
|
||||||
yllcorner 51.788295
|
* ncols 5000
|
||||||
xurcorner -2.146674
|
* nrows 5000
|
||||||
yurcorner 51.878474
|
* xllcorner -2.291359
|
||||||
cellsize 2
|
* yllcorner 51.788295
|
||||||
NODATA_value -9999
|
* xurcorner -2.146674
|
||||||
|
* yurcorner 51.878474
|
||||||
Tiles must be entered in the format -lid tile1.asc,tile2.asc,tile3.asc
|
* cellsize 2
|
||||||
*/
|
* NODATA_value -9999
|
||||||
|
*
|
||||||
|
* Tiles must be entered in the format
|
||||||
|
*
|
||||||
|
* -lid tile1.asc,tile2.asc,tile3.asc
|
||||||
|
*/
|
||||||
char *filename;
|
char *filename;
|
||||||
char *files[4]; // 4 tiles
|
char *files[4]; // 4 tiles
|
||||||
int x, y, cellsize,indx=0,fc=0,hoffset=0,voffset=0,pos;
|
int x, y, indx = 0, fc = 0, hoffset = 0, voffset = 0, pos,
|
||||||
double xll, yll, xur, yur;
|
dem_alloced = 0;
|
||||||
|
double xll, yll, xur, yur, cellsize;
|
||||||
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[50000];
|
||||||
char * pch;
|
char * pch;
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
|
|
||||||
|
|
||||||
// test for multiple files
|
// test for multiple files
|
||||||
filename = strtok(filenames, " ,");
|
filename = strtok(filenames, " ,");
|
||||||
while (filename != NULL)
|
while (filename != NULL) {
|
||||||
{
|
|
||||||
files[fc] = filename;
|
files[fc] = filename;
|
||||||
filename = strtok(NULL, " ,");
|
filename = strtok(NULL, " ,");
|
||||||
fc++;
|
fc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (indx<fc) {
|
while (indx < fc) {
|
||||||
fd = fopen(files[indx], "rb");
|
fd = fopen(files[indx], "rb");
|
||||||
|
|
||||||
if (fd != NULL) {
|
if (fd != NULL) {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
fprintf(stdout,"Loading \"%s\" into page %d...\n",files[indx], indx);
|
fprintf(stdout, "Loading \"%s\" into page %d...\n", files[indx], indx);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
if (fgets(line, 19, fd) != NULL) {
|
if (fgets(line, 19, fd) != NULL) {
|
||||||
pch = strtok (line," ");
|
pch = strtok (line," ");
|
||||||
pch = strtok (NULL, " ");
|
pch = strtok (NULL, " ");
|
||||||
width=atoi(pch);
|
width = atoi(pch);
|
||||||
|
|
||||||
|
if (!dem_alloced) {
|
||||||
|
IPPD = width;
|
||||||
|
ARRAYSIZE = (MAXPAGES * IPPD) + 10;
|
||||||
|
|
||||||
|
do_allocs();
|
||||||
|
dem_alloced = 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (fgets(line, 19, fd) != NULL) {
|
if (fgets(line, 19, fd) != NULL)
|
||||||
height=atoi(pch);
|
height = atoi(pch);
|
||||||
}
|
fgets(line, 24, fd);
|
||||||
fgets(line, 24, fd); //
|
|
||||||
|
|
||||||
if (fgets(line, 24, fd) != NULL) {
|
if (fgets(line, 24, fd) != NULL) {
|
||||||
//xll=atof(pch);
|
//xll=atof(pch);
|
||||||
sscanf(pch, "%lf", &xll);
|
sscanf(pch, "%lf", &xll);
|
||||||
}
|
}
|
||||||
fgets(line, 24, fd); //
|
fgets(line, 24, fd);
|
||||||
if (fgets(line, 24, fd) != NULL) {
|
if (fgets(line, 24, fd) != NULL) {
|
||||||
//yll=atof(pch);
|
//yll=atof(pch);
|
||||||
sscanf(pch, "%lf", &yll);
|
sscanf(pch, "%lf", &yll);
|
||||||
}
|
}
|
||||||
|
|
||||||
fgets(line, 24, fd); //
|
fgets(line, 24, fd);
|
||||||
|
|
||||||
if (fgets(line, 24, fd) != NULL) {
|
if (fgets(line, 24, fd) != NULL) {
|
||||||
//xur=atof(pch);
|
//xur=atof(pch);
|
||||||
sscanf(pch, "%lf", &xur);
|
sscanf(pch, "%lf", &xur);
|
||||||
}
|
}
|
||||||
|
|
||||||
fgets(line, 24, fd); //
|
fgets(line, 24, fd);
|
||||||
|
|
||||||
if (fgets(line, 24, fd) != NULL) {
|
if (fgets(line, 24, fd) != NULL) {
|
||||||
//yur=atof(pch);
|
//yur=atof(pch);
|
||||||
sscanf(pch, "%lf", &yur);
|
sscanf(pch, "%lf", &yur);
|
||||||
}
|
|
||||||
|
|
||||||
fgets(line, 15, fd); //
|
|
||||||
|
|
||||||
if (fgets(line, 15, fd) != NULL) {
|
|
||||||
cellsize=atoi(pch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fgets(line, 15, fd);
|
||||||
|
|
||||||
|
if (fgets(line, 15, fd) != NULL)
|
||||||
|
cellsize = strtod(pch, NULL);
|
||||||
|
|
||||||
|
// LIDAR 10m @ 10800 PPD
|
||||||
|
if (cellsize == 10.0)
|
||||||
|
MAXRAD = 30;
|
||||||
// LIDAR 2m @ 54000 PPD
|
// LIDAR 2m @ 54000 PPD
|
||||||
if(cellsize==2){
|
if (cellsize == 2.0)
|
||||||
ippd=5000;
|
MAXRAD = 15;
|
||||||
MAXRAD=15;
|
|
||||||
}
|
|
||||||
// LIDAR 1m @ 108000 PPD!
|
// LIDAR 1m @ 108000 PPD!
|
||||||
if(cellsize==1){
|
if (cellsize == 1.0)
|
||||||
ippd=10000;
|
MAXRAD = 10;
|
||||||
MAXRAD=10;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(xur<eastoffset)
|
if (xur < eastoffset)
|
||||||
eastoffset=xur;
|
eastoffset = xur;
|
||||||
if(xll>westoffset)
|
if (xll > westoffset)
|
||||||
westoffset=xll;
|
westoffset = xll;
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
fprintf(stdout, "PRE yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n", yll, yur, xur, xll, delta);
|
||||||
|
|
||||||
if(debug){
|
|
||||||
fprintf(stdout,"PRE yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n",yll,yur,xur,xll,delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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)
|
||||||
}
|
xll = xll * -1;
|
||||||
if(xll < 0){
|
if(xur < 0)
|
||||||
xll=xll*-1;
|
xur = xur * -1;
|
||||||
}
|
}
|
||||||
if(xur < 0){
|
if (debug)
|
||||||
xur=xur*-1;
|
fprintf(stdout, "POST yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n", yll, yur, xur, xll, delta);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(debug){
|
|
||||||
fprintf(stdout,"POST yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n",yll,yur,xur,xll,delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (yll < min_north)
|
if (yll < min_north)
|
||||||
min_north=yll;
|
min_north = yll;
|
||||||
if (yur > max_north)
|
if (yur > max_north)
|
||||||
max_north=yur;
|
max_north = yur;
|
||||||
|
|
||||||
fgets(line, 30, fd); // NODATA
|
fgets(line, 30, fd); // NODATA
|
||||||
pos=ftell(fd);
|
pos = ftell(fd);
|
||||||
|
|
||||||
// tile 0 [x| ]
|
// tile 0 [x| ]
|
||||||
if(debug){
|
if (debug)
|
||||||
fprintf(stdout,"readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n",0,0,height,width,indx,yur,xur,yll,xll);
|
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", 0, 0, height, width, indx, yur, xur, yll, xll);
|
||||||
}
|
|
||||||
readLIDAR(fd,0,0,height,width,indx,yur,xur,yll,xll);
|
|
||||||
|
|
||||||
|
readLIDAR(fd, 0, 0, height, width, indx, yur, xur, yll,
|
||||||
|
xll);
|
||||||
//rewind
|
//rewind
|
||||||
fseek(fd,pos,SEEK_SET);
|
fseek(fd, pos, SEEK_SET);
|
||||||
|
|
||||||
// tile 1 [ |x]
|
// tile 1 [ |x]
|
||||||
if(width==10000){
|
if (width == 2000 ||
|
||||||
|
width == 10000 ||
|
||||||
|
width == 10082) {
|
||||||
indx++;
|
indx++;
|
||||||
if(debug){
|
if (debug)
|
||||||
fprintf(stdout,"readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n",5000,0,height,width,indx,yur,xur,yll,xll);
|
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", width / 2, 0, height, width, indx, yur, xur, yll, xll);
|
||||||
}
|
|
||||||
readLIDAR(fd,5000,0,height,width,indx,yur,xur,yll,xll);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
readLIDAR(fd, width / 2, 0, height, width,
|
||||||
|
indx, yur, xur, yll, xll);
|
||||||
|
}
|
||||||
//rewind
|
//rewind
|
||||||
fseek(fd,pos,SEEK_SET);
|
fseek(fd, pos, SEEK_SET);
|
||||||
|
|
||||||
// tile 2 [x | ]
|
// tile 2 [x | ]
|
||||||
if(height==10000){
|
if (height == 2000 ||
|
||||||
|
height == 10000 ||
|
||||||
|
height == 10082) {
|
||||||
indx++;
|
indx++;
|
||||||
if(debug){
|
if (debug)
|
||||||
fprintf(stdout,"readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n",0,5000,height,width,indx,yur,xur,yll,xll);
|
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", 0, height / 2, height, width, indx, yur, xur, yll, xll);
|
||||||
}
|
|
||||||
readLIDAR(fd,0,5000,height,width,indx,yur,xur,yll,xll);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
readLIDAR(fd, 0, height / 2, height, width,
|
||||||
|
indx, yur, xur, yll, xll);
|
||||||
|
}
|
||||||
//rewind
|
//rewind
|
||||||
fseek(fd,pos,SEEK_SET);
|
fseek(fd, pos, SEEK_SET);
|
||||||
|
|
||||||
// tile 3 [ |x]
|
// tile 3 [ |x]
|
||||||
if(width==10000 && height==10000){
|
if ((width == 2000 && height == 2000) ||
|
||||||
|
(width == 10000 && height == 10000) ||
|
||||||
|
(width == 10082 && height == 10082)) {
|
||||||
indx++;
|
indx++;
|
||||||
if(debug){
|
if (debug)
|
||||||
fprintf(stdout,"readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n",5000,5000,height,width,indx,yur,xur,yll,xll);
|
fprintf(stdout, "readLIDAR(fd,%d,%d,%d,%d,%d,%.4f,%.4f,%.4f,%.4f)\n", width / 2, height / 2, height, width, indx, yur, xur, yll, xll);
|
||||||
}
|
|
||||||
readLIDAR(fd,5000,5000,height,width,indx,yur,xur,yll,xll);
|
readLIDAR(fd, width / 2, height / 2, height,
|
||||||
|
width, indx, yur, xur, yll,
|
||||||
|
xll);
|
||||||
}
|
}
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
if (debug)
|
||||||
fprintf(stdout,"LIDAR LOADED %d x %d\n",width,height);
|
fprintf(stdout, "LIDAR LOADED %d x %d\n", width, height);
|
||||||
} // if (fd != NULL)
|
} else {
|
||||||
else
|
|
||||||
return -1;
|
return -1;
|
||||||
indx++;
|
}
|
||||||
|
indx++;
|
||||||
} // filename(s)
|
} // filename(s)
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LoadSDF_SDF(char *name)
|
int LoadSDF_SDF(char *name)
|
||||||
|
142
main.cc
142
main.cc
@@ -1,6 +1,6 @@
|
|||||||
double version = 2.75;
|
double version = 2.8;
|
||||||
/****************************************************************************\
|
/****************************************************************************\
|
||||||
* Signal Server: Server optimised SPLAT! by Alex Farrant, M6ZUJ *
|
* Signal Server: Radio propagation simulator by Alex Farrant QCVS, 2E0TDW *
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* SPLAT! Project started in 1997 by John A. Magliacane, KD2BD *
|
* SPLAT! Project started in 1997 by John A. Magliacane, KD2BD *
|
||||||
* *
|
* *
|
||||||
@@ -981,6 +981,24 @@ void alloc_path(void)
|
|||||||
path.distance = new double[ARRAYSIZE];
|
path.distance = new double[ARRAYSIZE];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void do_allocs(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
alloc_elev();
|
||||||
|
alloc_dem();
|
||||||
|
alloc_path();
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPAGES; i++) {
|
||||||
|
dem[i].min_el = 32768;
|
||||||
|
dem[i].max_el = -32768;
|
||||||
|
dem[i].min_north = 90;
|
||||||
|
dem[i].max_north = -90;
|
||||||
|
dem[i].min_west = 360;
|
||||||
|
dem[i].max_west = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int x, y, z = 0, min_lat, min_lon, max_lat, max_lon,
|
int x, y, z = 0, min_lat, min_lon, max_lat, max_lon,
|
||||||
@@ -1006,66 +1024,55 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (strstr(argv[0], "signalserverLIDAR")) {
|
if (strstr(argv[0], "signalserverLIDAR")) {
|
||||||
MAXPAGES = 4;
|
MAXPAGES = 4;
|
||||||
IPPD = 5000; // // 2m resolution default
|
lidar = 1;
|
||||||
ARRAYSIZE = 20010;
|
IPPD = 5000;
|
||||||
ppd=IPPD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(ss_name, "Signal Server\0", 14);
|
strncpy(ss_name, "Signal Server\0", 14);
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
|
|
||||||
fprintf(stdout, "\n\t\t -- %s %.2f --\n", ss_name, version);
|
fprintf(stdout, "Version: %s %.2f (Built for %d DEM tiles at %d pixels)\n", ss_name, version,MAXPAGES, IPPD);
|
||||||
fprintf(stdout,
|
fprintf(stdout, "License: GNU General Public License (GPL) version 2\n\n");
|
||||||
"\tSet for %d tiles at %d pixels/degree\n\n",
|
fprintf(stdout, "Radio propagation simulator by Alex Farrant QCVS, 2E0TDW\n");
|
||||||
MAXPAGES, IPPD);
|
fprintf(stdout, "Based upon SPLAT! by John Magliacane, KD2BD\n\n");
|
||||||
fprintf(stdout, " -sdf Directory containing .sdf tiles\n");
|
fprintf(stdout, "Usage: signalserver [data options] [input options] [output options] -o outputfile\n\n");
|
||||||
fprintf(stdout, " -lid LIDAR ASCII tile with WGS84 bounds (Dimensions defined in file metadata)\n");
|
fprintf(stdout, "Data:\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -sdf Directory containing SRTM derived .sdf DEM tiles\n");
|
||||||
" -lat Tx Latitude (decimal degrees) -70/+70\n");
|
fprintf(stdout, " -lid ASCII grid tile (LIDAR) with dimensions and resolution defined in header\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -udt User defined CSV clutter file\n");
|
||||||
" -lon Tx Longitude (decimal degrees) -180/+180\n");
|
fprintf(stdout, "Input:\n");
|
||||||
|
fprintf(stdout, " -lat Tx Latitude (decimal degrees) -70/+70\n");
|
||||||
|
fprintf(stdout, " -lon Tx Longitude (decimal degrees) -180/+180\n");
|
||||||
fprintf(stdout, " -txh Tx Height (above ground)\n");
|
fprintf(stdout, " -txh Tx Height (above ground)\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -rla (Optional) Rx Latitude for PPA (decimal degrees) -70/+70\n");
|
||||||
" -rla (Optional) Rx Latitude for PPA (decimal degrees) -70/+70\n");
|
fprintf(stdout, " -rlo (Optional) Rx Longitude for PPA (decimal degrees) -180/+180\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)\n");
|
||||||
" -rlo (Optional) Rx Longitude for PPA (decimal degrees) -180/+180\n");
|
fprintf(stdout, " -erp Tx Effective Radiated Power (Watts)\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -rxh Rx Height(s) (optional. Default=0.1)\n");
|
||||||
" -f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)\n");
|
fprintf(stdout, " -hp Horizontal Polarisation (default=vertical)\n");
|
||||||
fprintf(stdout,
|
|
||||||
" -erp Tx Effective Radiated Power (Watts)\n");
|
|
||||||
fprintf(stdout,
|
|
||||||
" -rxh Rx Height(s) (optional. Default=0.1)\n");
|
|
||||||
fprintf(stdout, " -rt Rx Threshold (dB / dBm / dBuV/m)\n");
|
|
||||||
fprintf(stdout,
|
|
||||||
" -hp Horizontal Polarisation (default=vertical)\n");
|
|
||||||
fprintf(stdout, " -gc Ground clutter (feet/meters)\n");
|
fprintf(stdout, " -gc Ground clutter (feet/meters)\n");
|
||||||
fprintf(stdout, " -udt User defined terrain filename\n");
|
|
||||||
fprintf(stdout,
|
|
||||||
" -dbm Plot Rxd signal power instead of field strength\n");
|
|
||||||
fprintf(stdout, " -m Metric units of measurement\n");
|
fprintf(stdout, " -m Metric units of measurement\n");
|
||||||
fprintf(stdout, " -te Terrain code 1-6 (optional)\n");
|
fprintf(stdout, " -te Terrain code 1-6 (optional)\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -terdic Terrain dielectric value 2-80 (optional)\n");
|
||||||
" -terdic Terrain dielectric value 2-80 (optional)\n");
|
fprintf(stdout, " -tercon Terrain conductivity 0.01-0.0001 (optional)\n");
|
||||||
fprintf(stdout,
|
|
||||||
" -tercon Terrain conductivity 0.01-0.0001 (optional)\n");
|
|
||||||
fprintf(stdout, " -cl Climate code 1-6 (optional)\n");
|
fprintf(stdout, " -cl Climate code 1-6 (optional)\n");
|
||||||
|
fprintf(stdout, "Output:\n");
|
||||||
|
fprintf(stdout, " -dbm Plot Rxd signal power instead of field strength\n");
|
||||||
|
fprintf(stdout, " -rt Rx Threshold (dB / dBm / dBuV/m)\n");
|
||||||
fprintf(stdout, " -o Filename. Required. \n");
|
fprintf(stdout, " -o Filename. Required. \n");
|
||||||
fprintf(stdout, " -R Radius (miles/kilometers)\n");
|
fprintf(stdout, " -R Radius (miles/kilometers)\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -res Pixels per tile. 300/600/1200/3600 (Optional. LIDAR res is within the tile)\n");
|
||||||
" -res Pixels per tile. 300/600/1200/3600 (Optional. LIDAR res is defined within the tile)\n");
|
fprintf(stdout, " -pm Propagation model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,\n");
|
||||||
fprintf(stdout, " -t Terrain background\n");
|
fprintf(stdout, " 5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -pe Propagation model mode: 1=Urban,2=Suburban,3=Rural\n");
|
||||||
" -pm Prop model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,\n");
|
fprintf(stdout, " -ked Knife edge diffraction (Already on for ITM)\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, "Debugging:\n");
|
||||||
" 5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson\n");
|
fprintf(stdout, " -t Terrain greyscale background\n");
|
||||||
fprintf(stdout,
|
fprintf(stdout, " -dbg Verbose debug messages\n");
|
||||||
" -pe Prop model mode: 1=Urban,2=Suburban,3=Rural\n");
|
|
||||||
fprintf(stdout,
|
|
||||||
" -ked Knife edge diffraction (Default for ITM)\n");
|
|
||||||
fprintf(stdout, " -ng Normalise Path Profile graph\n");
|
fprintf(stdout, " -ng Normalise Path Profile graph\n");
|
||||||
fprintf(stdout, " -haf Halve 1 or 2 (optional)\n");
|
fprintf(stdout, " -haf Halve 1 or 2 (optional)\n");
|
||||||
fprintf(stdout, " -nothreads Turn off threaded processing (optional)\n");
|
fprintf(stdout, " -nothreads Turn off threaded processing\n");
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
@@ -1073,12 +1080,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now we know what mode we are running in, we can allocate various
|
* If we're not called as signalserverLIDAR we can allocate various
|
||||||
* data structures.
|
* memory now. For LIDAR stuff we need to wait until we've pasred
|
||||||
|
* the headers in the .asc file to know how much memory to allocate.
|
||||||
*/
|
*/
|
||||||
alloc_elev();
|
if (!lidar)
|
||||||
alloc_dem();
|
do_allocs();
|
||||||
alloc_path();
|
|
||||||
|
|
||||||
y = argc - 1;
|
y = argc - 1;
|
||||||
kml = 0;
|
kml = 0;
|
||||||
@@ -1129,15 +1136,6 @@ int main(int argc, char *argv[])
|
|||||||
tx_site[1].lat = 91.0;
|
tx_site[1].lat = 91.0;
|
||||||
tx_site[1].lon = 361.0;
|
tx_site[1].lon = 361.0;
|
||||||
|
|
||||||
for (x = 0; x < MAXPAGES; x++) {
|
|
||||||
dem[x].min_el = 32768;
|
|
||||||
dem[x].max_el = -32768;
|
|
||||||
dem[x].min_north = 90;
|
|
||||||
dem[x].max_north = -90;
|
|
||||||
dem[x].min_west = 360;
|
|
||||||
dem[x].max_west = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Scan for command line arguments */
|
/* Scan for command line arguments */
|
||||||
|
|
||||||
for (x = 1; x <= y; x++) {
|
for (x = 1; x <= y; x++) {
|
||||||
@@ -1211,7 +1209,10 @@ int main(int argc, char *argv[])
|
|||||||
if (strcmp(argv[x], "-res") == 0) {
|
if (strcmp(argv[x], "-res") == 0) {
|
||||||
z = x + 1;
|
z = x + 1;
|
||||||
|
|
||||||
if (z <= y && argv[z][0] && argv[z][0] != '-') {
|
if (!lidar &&
|
||||||
|
z <= y &&
|
||||||
|
argv[z][0] &&
|
||||||
|
argv[z][0] != '-') {
|
||||||
sscanf(argv[z], "%d", &ippd);
|
sscanf(argv[z], "%d", &ippd);
|
||||||
|
|
||||||
switch (ippd) {
|
switch (ippd) {
|
||||||
@@ -1574,7 +1575,17 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Load the required tiles */
|
/* Load the required tiles */
|
||||||
if(lidar){
|
if(lidar){
|
||||||
loadLIDAR(lidar_tiles);
|
int err;
|
||||||
|
|
||||||
|
err = loadLIDAR(lidar_tiles);
|
||||||
|
if (err) {
|
||||||
|
fprintf(stderr, "Couldn't find one or more of the "
|
||||||
|
"lidar files. Please ensure their paths are\n"
|
||||||
|
"correct and try again.\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
ippd = IPPD;
|
||||||
|
|
||||||
if(debug){
|
if(debug){
|
||||||
fprintf(stdout,"%.4f,%.4f,%.4f,%.4f\n",max_north,min_west,min_north,max_west);
|
fprintf(stdout,"%.4f,%.4f,%.4f,%.4f\n",max_north,min_west,min_north,max_west);
|
||||||
}
|
}
|
||||||
@@ -1745,10 +1756,5 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
// deprecated garbage collection
|
|
||||||
/*free_elev();
|
|
||||||
free_dem();
|
|
||||||
free_path();
|
|
||||||
*/
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
1
main.hh
1
main.hh
@@ -27,5 +27,6 @@ void free_elev(void);
|
|||||||
void free_path(void);
|
void free_path(void);
|
||||||
void alloc_elev(void);
|
void alloc_elev(void);
|
||||||
void alloc_path(void);
|
void alloc_path(void);
|
||||||
|
void do_allocs(void);
|
||||||
|
|
||||||
#endif /* _MAIN_HH_ */
|
#endif /* _MAIN_HH_ */
|
||||||
|
@@ -11,16 +11,13 @@
|
|||||||
#include "sui.hh"
|
#include "sui.hh"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define MAXPAGES 64
|
|
||||||
#define IPPD 5000
|
|
||||||
#define NUM_SECTIONS 4
|
#define NUM_SECTIONS 4
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
pthread_t threads[NUM_SECTIONS];
|
pthread_t threads[NUM_SECTIONS];
|
||||||
unsigned int thread_count = 0;
|
unsigned int thread_count = 0;
|
||||||
pthread_mutex_t maskMutex;
|
pthread_mutex_t maskMutex;
|
||||||
|
bool ***processed;
|
||||||
bool processed[MAXPAGES][IPPD][IPPD];
|
|
||||||
bool has_init_processed = false;
|
bool has_init_processed = false;
|
||||||
|
|
||||||
struct propagationRange {
|
struct propagationRange {
|
||||||
@@ -81,13 +78,25 @@ namespace {
|
|||||||
|
|
||||||
void init_processed()
|
void init_processed()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAXPAGES; i++) {
|
int i;
|
||||||
for (int x = 0; x < ippd; x++) {
|
int x;
|
||||||
for (int y = 0; y < ippd; y++) {
|
int y;
|
||||||
|
|
||||||
|
processed = new bool **[MAXPAGES];
|
||||||
|
for (i = 0; i < MAXPAGES; i++) {
|
||||||
|
processed[i] = new bool *[ippd];
|
||||||
|
for (x = 0; x < ippd; x++)
|
||||||
|
processed[i][x] = new bool [ippd];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPAGES; i++) {
|
||||||
|
for (x = 0; x < ippd; x++) {
|
||||||
|
for (y = 0; y < ippd; y++)
|
||||||
processed[i][x][y] = false;
|
processed[i][x][y] = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
has_init_processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool can_process(double lat, double lon)
|
bool can_process(double lat, double lon)
|
||||||
|
BIN
signalserver
BIN
signalserver
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
signalserver
|
|
@@ -1 +0,0 @@
|
|||||||
signalserver
|
|
Reference in New Issue
Block a user