@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | date_default_timezone_set('UTC'); |
| 27 | 27 | //waypoint plotting |
| 28 | 28 | $output .= '{"type": "Feature",'; |
| 29 | - $output .= '"properties": {'; |
|
| 29 | + $output .= '"properties": {'; |
|
| 30 | 30 | $output .= '"segment_name": "'.$spotter_item['segment_name'].'",'; |
| 31 | 31 | $output .= '"base": "'.$spotter_item['base'].'",'; |
| 32 | 32 | $output .= '"top": "'.$spotter_item['top'].'",'; |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | $output .= '"stroke": "#f0f0f0",'; |
| 50 | 50 | $output .= '"stroke-width": 2'; |
| 51 | 51 | // } |
| 52 | - $output .= '},'; |
|
| 53 | - $output .= '"geometry": {'; |
|
| 52 | + $output .= '},'; |
|
| 53 | + $output .= '"geometry": {'; |
|
| 54 | 54 | $output .= '"type": "LineString",'; |
| 55 | 55 | $output .= '"coordinates": ['; |
| 56 | - //$output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].'], ['.$spotter_item['longitude_end_seg2'].', '.$spotter_item['latitude_end_seg2'].']'; |
|
| 57 | - $output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].','.round($spotter_item['base']*100*0.3048).'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].','.round($spotter_item['base']*100*0.3048).']'; |
|
| 56 | + //$output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].'], ['.$spotter_item['longitude_end_seg2'].', '.$spotter_item['latitude_end_seg2'].']'; |
|
| 57 | + $output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].','.round($spotter_item['base']*100*0.3048).'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].','.round($spotter_item['base']*100*0.3048).']'; |
|
| 58 | 58 | // $output .= '['.$spotter_item['latitude_begin'].', '.$spotter_item['longitude_begin'].'], ['.$spotter_item['latitude_end'].', '.$spotter_item['longitude_end'].']'; |
| 59 | 59 | $output .= ']'; |
| 60 | - $output .= '}'; |
|
| 60 | + $output .= '}'; |
|
| 61 | 61 | /* $output .= '"geometry": {'; |
| 62 | 62 | $output .= '"type": "Point",'; |
| 63 | 63 | $output .= '"coordinates": ['; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $output .= '},'; |
| 69 | 69 | //waypoint plotting |
| 70 | 70 | $output .= '{"type": "Feature",'; |
| 71 | - $output .= '"properties": {'; |
|
| 71 | + $output .= '"properties": {'; |
|
| 72 | 72 | $output .= '"ident": "'.$spotter_item['name_begin'].'",'; |
| 73 | 73 | $output .= '"high": "'.$spotter_item['high'].'",'; |
| 74 | 74 | $output .= '"alt": "'.$spotter_item['base'].'",'; |
@@ -98,17 +98,17 @@ discard block |
||
| 98 | 98 | $output .= '"marker-size": "small",'; |
| 99 | 99 | $output .= '"marker-color": "#0000ff"'; |
| 100 | 100 | } |
| 101 | - $output .= '},'; |
|
| 102 | - $output .= '"geometry": {'; |
|
| 101 | + $output .= '},'; |
|
| 102 | + $output .= '"geometry": {'; |
|
| 103 | 103 | $output .= '"type": "Point",'; |
| 104 | 104 | $output .= '"coordinates": ['; |
| 105 | - $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);; |
|
| 105 | + $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);; |
|
| 106 | 106 | $output .= ']'; |
| 107 | - $output .= '}'; |
|
| 107 | + $output .= '}'; |
|
| 108 | 108 | |
| 109 | 109 | $output .= '},'; |
| 110 | 110 | $output .= '{"type": "Feature",'; |
| 111 | - $output .= '"properties": {'; |
|
| 111 | + $output .= '"properties": {'; |
|
| 112 | 112 | $output .= '"ident": "'.$spotter_item['name_end'].'",'; |
| 113 | 113 | $output .= '"high": "'.$spotter_item['high'].'",'; |
| 114 | 114 | $output .= '"alt": "'.$spotter_item['top'].'",'; |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | $output .= '"marker-size": "small",'; |
| 146 | 146 | $output .= '"marker-color": "#0000ff"'; |
| 147 | 147 | } |
| 148 | - $output .= '},'; |
|
| 149 | - $output .= '"geometry": {'; |
|
| 148 | + $output .= '},'; |
|
| 149 | + $output .= '"geometry": {'; |
|
| 150 | 150 | $output .= '"type": "Point",'; |
| 151 | 151 | $output .= '"coordinates": ['; |
| 152 | - $output .= $spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].', '.round($spotter_item['base']*100*0.3048); |
|
| 152 | + $output .= $spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].', '.round($spotter_item['base']*100*0.3048); |
|
| 153 | 153 | $output .= ']'; |
| 154 | - $output .= '}'; |
|
| 154 | + $output .= '}'; |
|
| 155 | 155 | |
| 156 | 156 | $output .= '},'; |
| 157 | 157 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | if (isset($_GET['coord'])) |
| 12 | 12 | { |
| 13 | - $coords = explode(',',$_GET['coord']); |
|
| 13 | + $coords = explode(',', $_GET['coord']); |
|
| 14 | 14 | $spotter_array = $Spotter->getAllWaypointsInfobyCoord($coords); |
| 15 | 15 | } else { |
| 16 | 16 | die; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | if (!empty($spotter_array)) |
| 22 | 22 | { |
| 23 | 23 | // print_r($spotter_array); |
| 24 | - foreach($spotter_array as $spotter_item) |
|
| 24 | + foreach ($spotter_array as $spotter_item) |
|
| 25 | 25 | { |
| 26 | 26 | date_default_timezone_set('UTC'); |
| 27 | 27 | //waypoint plotting |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $output .= '"geometry": {'; |
| 103 | 103 | $output .= '"type": "Point",'; |
| 104 | 104 | $output .= '"coordinates": ['; |
| 105 | - $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);; |
|
| 105 | + $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048); ; |
|
| 106 | 106 | $output .= ']'; |
| 107 | 107 | $output .= '}'; |
| 108 | 108 | |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | <button type="button" class="close">×</button> |
| 8 | 8 | <?php |
| 9 | 9 | |
| 10 | -$airspaceid = filter_input(INPUT_GET,'airspace',FILTER_SANITIZE_NUMBER_INT); |
|
| 10 | +$airspaceid = filter_input(INPUT_GET, 'airspace', FILTER_SANITIZE_NUMBER_INT); |
|
| 11 | 11 | //$notamref = urldecode($notamref); |
| 12 | 12 | if ($globalDBdriver == 'mysql') { |
| 13 | 13 | $query = "SELECT * FROM airspace WHERE ogr_fid = :id"; |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | try { |
| 19 | 19 | $sth = $Connection->db->prepare($query); |
| 20 | 20 | $sth->execute(array(':id' => $airspaceid)); |
| 21 | -} catch(PDOException $e) { |
|
| 21 | +} catch (PDOException $e) { |
|
| 22 | 22 | echo "error"; |
| 23 | 23 | } |
| 24 | -$result=$sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 24 | +$result = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 25 | 25 | $airspace = $result[0]; |
| 26 | 26 | date_default_timezone_set('UTC'); |
| 27 | 27 | print '<div class="top">'; |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | $airspace = $result[0]; |
| 26 | 26 | date_default_timezone_set('UTC'); |
| 27 | 27 | print '<div class="top">'; |
| 28 | -if (isset($airspace['name'])) $airspace['title'] = $airspace['name']; |
|
| 28 | +if (isset($airspace['name'])) { |
|
| 29 | + $airspace['title'] = $airspace['name']; |
|
| 30 | +} |
|
| 29 | 31 | print '<div class="right"><div class="callsign-details"><div class="callsign">'.$airspace['title'].'</a></div>'; |
| 30 | 32 | print '</div>'; |
| 31 | 33 | print '<div class="details">'; |
@@ -44,13 +46,17 @@ discard block |
||
| 44 | 46 | print '</div>'; |
| 45 | 47 | } |
| 46 | 48 | |
| 47 | -if (isset($airspace['ceiling'])) $airspace['tops'] = $airspace['ceiling']; |
|
| 49 | +if (isset($airspace['ceiling'])) { |
|
| 50 | + $airspace['tops'] = $airspace['ceiling']; |
|
| 51 | +} |
|
| 48 | 52 | print '<div>'; |
| 49 | 53 | print '<span>'._("Tops").'</span>'; |
| 50 | 54 | print $airspace['tops']; |
| 51 | 55 | print '</div>'; |
| 52 | 56 | |
| 53 | -if (isset($airspace['floor'])) $airspace['base'] = $airspace['floor']; |
|
| 57 | +if (isset($airspace['floor'])) { |
|
| 58 | + $airspace['base'] = $airspace['floor']; |
|
| 59 | +} |
|
| 54 | 60 | print '<div>'; |
| 55 | 61 | print '<span>'._("Base").'</span>'; |
| 56 | 62 | print $airspace['base']; |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | if (isset($_GET['coord'])) |
| 18 | 18 | { |
| 19 | - $coords = explode(',',$_GET['coord']); |
|
| 19 | + $coords = explode(',', $_GET['coord']); |
|
| 20 | 20 | if ($globalDBdriver == 'mysql') { |
| 21 | 21 | $query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))"; |
| 22 | 22 | try { |
| 23 | 23 | $sth = $Connection->db->prepare($query); |
| 24 | - $sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3])); |
|
| 24 | + $sth->execute(array(':minlon' => $coords[0], ':minlat' => $coords[1], ':maxlon' => $coords[2], ':maxlat' => $coords[3])); |
|
| 25 | 25 | //$sth->execute(); |
| 26 | - } catch(PDOException $e) { |
|
| 26 | + } catch (PDOException $e) { |
|
| 27 | 27 | echo "error"; |
| 28 | 28 | } |
| 29 | 29 | } else { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $sth = $Connection->db->prepare($query); |
| 33 | 33 | //$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3])); |
| 34 | 34 | $sth->execute(); |
| 35 | - } catch(PDOException $e) { |
|
| 35 | + } catch (PDOException $e) { |
|
| 36 | 36 | echo "error"; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | try { |
| 46 | 46 | $sth = $Connection->db->prepare($query); |
| 47 | 47 | $sth->execute(); |
| 48 | - } catch(PDOException $e) { |
|
| 48 | + } catch (PDOException $e) { |
|
| 49 | 49 | echo "error"; |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -73,20 +73,20 @@ discard block |
||
| 73 | 73 | elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid']; |
| 74 | 74 | if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling']; |
| 75 | 75 | if (isset($properties['floor'])) $properties['base'] = $properties['floor']; |
| 76 | - if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) { |
|
| 76 | + if (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['tops']), $matches)) { |
|
| 77 | 77 | $properties['upper_limit'] = round($matches['alt']*100*0.38048); |
| 78 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) { |
|
| 78 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['tops']), $matches)) { |
|
| 79 | 79 | $properties['upper_limit'] = round($matches['alt']*0.38048); |
| 80 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['tops']),$matches)) { |
|
| 80 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['tops']), $matches)) { |
|
| 81 | 81 | $properties['upper_limit'] = $matches['alt']; |
| 82 | 82 | } |
| 83 | 83 | if ($properties['base'] == 'SFC' || $properties['base'] == 'MSL' || $properties['base'] == 'GROUND' || $properties['base'] == 'GND') { |
| 84 | 84 | $properties['lower_limit'] = 0; |
| 85 | - } elseif (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['base']),$matches)) { |
|
| 85 | + } elseif (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['base']), $matches)) { |
|
| 86 | 86 | $properties['lower_limit'] = round($matches['alt']*100*0.38048); |
| 87 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['base']),$matches)) { |
|
| 87 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['base']), $matches)) { |
|
| 88 | 88 | $properties['lower_limit'] = round($matches['alt']*0.38048); |
| 89 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['base']),$matches)) { |
|
| 89 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['base']), $matches)) { |
|
| 90 | 90 | $properties['lower_limit'] = $matches['alt']; |
| 91 | 91 | } |
| 92 | 92 | if ($properties['type'] == 'RESTRICTED' || $properties['type'] == 'R') { |
@@ -67,12 +67,22 @@ |
||
| 67 | 67 | } else { |
| 68 | 68 | $geom = geoPHP::load(stream_get_contents($row['wkb'])); |
| 69 | 69 | } |
| 70 | - if (isset($properties['type'])) $properties['type'] = trim($properties['type']); |
|
| 71 | - elseif (isset($properties['class'])) $properties['type'] = trim($properties['class']); |
|
| 72 | - if (isset($properties['ogr_fid'])) $properties['id'] = $properties['ogr_fid']; |
|
| 73 | - elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid']; |
|
| 74 | - if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling']; |
|
| 75 | - if (isset($properties['floor'])) $properties['base'] = $properties['floor']; |
|
| 70 | + if (isset($properties['type'])) { |
|
| 71 | + $properties['type'] = trim($properties['type']); |
|
| 72 | + } elseif (isset($properties['class'])) { |
|
| 73 | + $properties['type'] = trim($properties['class']); |
|
| 74 | + } |
|
| 75 | + if (isset($properties['ogr_fid'])) { |
|
| 76 | + $properties['id'] = $properties['ogr_fid']; |
|
| 77 | + } elseif (isset($properties['ogc_fid'])) { |
|
| 78 | + $properties['id'] = $properties['ogc_fid']; |
|
| 79 | + } |
|
| 80 | + if (isset($properties['ceiling'])) { |
|
| 81 | + $properties['tops'] = $properties['ceiling']; |
|
| 82 | + } |
|
| 83 | + if (isset($properties['floor'])) { |
|
| 84 | + $properties['base'] = $properties['floor']; |
|
| 85 | + } |
|
| 76 | 86 | if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) { |
| 77 | 87 | $properties['upper_limit'] = round($matches['alt']*100*0.38048); |
| 78 | 88 | } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) { |