2 # currently, browse/tower just shows all towers, so do the same here
3 my @towers = qsearch({ table => 'tower' });
4 http_header('Content-Type' => 'text/csv');
5 http_header('Content-Disposition' => 'attachment;filename=towers.csv');
6 if ( $cgi->param('format') eq 'tc' ) {
7 # towercoverage.com format: not a true CSV, no quoting (so no way to include
8 # commas in any field, so we strip them)
10 # lat/long are signed decimals, northeast positive
12 # Description/Group are not necessary
13 # sector/antenna information (orientation, beamwidth, gain, frequency,
14 # etc.) is in what TC calls a "Coverage", which can't be edited this way.
15 my $text = "SiteName,Latitude,Longitude,Description,Group,Height\n";
17 foreach my $tower (@towers) {
18 next if ( !$tower->latitude or !$tower->longitude );
20 my $name = $tower->towername;
21 my $height = ($tower->height || 0) / 3.28;
34 die('unknown format '.$cgi->param('format'));