diff --git a/client/src/helper/mapHelpers.ts b/client/src/helper/mapHelpers.ts index 473646abe..9f5db1465 100644 --- a/client/src/helper/mapHelpers.ts +++ b/client/src/helper/mapHelpers.ts @@ -21,7 +21,26 @@ export function convertMapBoundsToQueryString(data: L.Polyline): string { export function createAirspacePopupContent(airspace: Airspace): string { const upperLimitInMeters = tryToConvertToMeters(airspace.ceiling); const lowerLimitInMeters = tryToConvertToMeters(airspace.floor); - return `Name: ${airspace.name}
Class: ${airspace.class}
Ceiling: ${airspace.ceiling}${upperLimitInMeters}
Floor: ${airspace.floor}${lowerLimitInMeters}`; + let content = `Name: ${airspace.name}
+ Class: ${airspace.class}
+ Ceiling: ${airspace.ceiling}${upperLimitInMeters}
+ Floor: ${airspace.floor}${lowerLimitInMeters}`; + + if (airspace.class.toLowerCase() == "w") { + const gliderSectorInfoLink = + "https://www.daec.de/fachbereiche/luftraum-flugsicherheit-betrieb/segelflugsektoren/"; + + content += ` +

+ + Es handelt sich hier um einen Segelflugsektor. Dieser mildert unter Umständen die Vorgaben des umgebenen Luftraums. +

+ Für weitere Informationen siehe: + ${gliderSectorInfoLink} +
+ `; + } + return content; } function tryToConvertToMeters(value: string): string { @@ -112,6 +131,7 @@ export function drawAirspaceViolationMarkers( function createViolationPopupContent(violation: AirspaceViolation) { return `GPS Höhe: ${violation.gpsAltitude} m
ISA Höhe: ${violation.pressureAltitude ?? "N/A"} m +
Luftraum: ${violation.airspaceName}
Untergrenze: ${violation.lowerLimitOriginal} / ${Math.round( violation.lowerLimitMeter )} m diff --git a/server/service/AirspaceService.js b/server/service/AirspaceService.js index 7161be6a3..54b2810a9 100644 --- a/server/service/AirspaceService.js +++ b/server/service/AirspaceService.js @@ -19,16 +19,8 @@ const service = { }); }, - /** - * class='W' will not be retrieved - */ getAllRelevant: async () => { const result = await Airspace.findAll({ - where: { - class: { - [Op.notIn]: ["W"], - }, - }, // To ensure that lower level airspaces are not overlayed by others we will sort these airspaces to the end order: [["floor", "asc"]], }); @@ -84,7 +76,7 @@ const service = { findViolationOfFL100(flightTrackLine, airspaceViolations); - const intersections2D = await findHorizontalIntersection( + const intersections2D = await findHorizontalIntersectionOfCriticalAirspaces( fixesWithElevation.id ); @@ -218,7 +210,11 @@ function createViolationEntry( }; } -async function findHorizontalIntersection(fixesId) { +/** + * Exclude zones like Q (e.g. parachute dropzone) and W (e.g. glider sector) from search of violations. + * Because there are no hard restrictions (Q) or they mitigate restrictions (W). + */ +async function findHorizontalIntersectionOfCriticalAirspaces(fixesId) { const query = ` SELECT id, class, name, floor, ceiling, "intersectionLine" FROM( SELECT *, (ST_Dump(ST_Intersection( @@ -255,7 +251,7 @@ async function findAirspacesWithinPolygon(points) { ))).geom AS "intersectionPolygon" FROM "Airspaces" WHERE season=date_part('year',now()) - AND NOT class='W') + ) AS "intersectionEntry" `;