Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion client/src/helper/mapHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}<br>Class: ${airspace.class}<br>Ceiling: ${airspace.ceiling}${upperLimitInMeters}<br>Floor: ${airspace.floor}${lowerLimitInMeters}`;
let content = `Name: ${airspace.name}<br>
Class: ${airspace.class}<br>
Ceiling: ${airspace.ceiling}${upperLimitInMeters}<br>
Floor: ${airspace.floor}${lowerLimitInMeters}`;

if (airspace.class.toLowerCase() == "w") {
const gliderSectorInfoLink =
"https://www.daec.de/fachbereiche/luftraum-flugsicherheit-betrieb/segelflugsektoren/";

content += `
<br><br>
<i>
Es handelt sich hier um einen Segelflugsektor. Dieser mildert unter Umständen die Vorgaben des umgebenen Luftraums.
<br><br>
Für weitere Informationen siehe:
<a href="${gliderSectorInfoLink}" target="_blank">${gliderSectorInfoLink}</a>
</i>
`;
}
return content;
}

function tryToConvertToMeters(value: string): string {
Expand Down Expand Up @@ -112,6 +131,7 @@ export function drawAirspaceViolationMarkers(
function createViolationPopupContent(violation: AirspaceViolation) {
return `GPS Höhe: ${violation.gpsAltitude} m
<br>ISA Höhe: ${violation.pressureAltitude ?? "N/A"} m
<br>Luftraum: ${violation.airspaceName}
<br>Untergrenze: ${violation.lowerLimitOriginal} / ${Math.round(
violation.lowerLimitMeter
)} m
Expand Down
18 changes: 7 additions & 11 deletions server/service/AirspaceService.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,8 @@ const service = {
});
},

/**
* class='W' will not be retrieved
*/
getAllRelevant: async () => {
const result = await Airspace.findAll({
where: {
class: {
[Op.notIn]: ["W"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aber dann sehen wir doch den W Luftraum wenn man da drauf flicht und nicht den eigentlichen. Das hatte ja irgendwie schon nen Sinn, das wir das so gemacht haben damals. Der W liegt ja immer komplett innerhalb eines anderen LR

Copy link
Copy Markdown
Member Author

@KaiWissel KaiWissel May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wie in folgendem Screenshot, sieht man anhand der "dunkleren" Überlagerung das da eigentlich noch mehr ist.
Aber ich kann das Pop-Up noch etwas tunen, so dass beide Airspaces erwähnt werden.

image_2023-05-29_11-36-39

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JEK58

So besser?
grafik

Wäre es nur umständlich möglich die Daten des darunter liegenden Luftraums im selben Pop-Up anzuzeigen.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JEK58

So besser? grafik

Wäre es nur umständlich möglich die Daten des darunter liegenden Luftraums im selben Pop-Up anzuzeigen.

Ne eigentlich nicht, man sieht ja den eigentlichen Airspace nicht und die meisten Leute raffen das mit den Segelflugsektoren ja offensichtlich eh nicht.
Ich würde die einfach garnicht anzeigen und ignorieren. Die liegen eh immer innerhalb eines LR auf den wir prüfen. Für den seltenen Fall, dass jemand einen Segelflugsektor nutzt wird er das plausibel erklären können. Alles andere verwirrt glaube ich nur oder verleitet zu dummen Aktionen wegen Halbwissen.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Und das ganze farblich anders darzustellen?

flyxc.app macht das z.B. so:
grafik

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja könnte man machen, aber mit gelb signalisiert man irgendwie auch, dass es nicht so schlimm wäre da einzufliegen. Ich würde es tatsächlich lassen wie es ist. 99% der Piloten sollten und dürfen da eh nicht rein;)

},
},
// To ensure that lower level airspaces are not overlayed by others we will sort these airspaces to the end
order: [["floor", "asc"]],
});
Expand Down Expand Up @@ -84,7 +76,7 @@ const service = {

findViolationOfFL100(flightTrackLine, airspaceViolations);

const intersections2D = await findHorizontalIntersection(
const intersections2D = await findHorizontalIntersectionOfCriticalAirspaces(
fixesWithElevation.id
);

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"
`;

Expand Down