added MRT sds image

This commit is contained in:
PxlLoewe
2025-06-07 00:34:30 -07:00
parent 6be3f70371
commit dd53110500
16 changed files with 1853 additions and 136 deletions

View File

@@ -0,0 +1,18 @@
import { point, multiPolygon, booleanPointInPolygon } from "@turf/turf";
import leitstellenGeoJSON from "../_components/map/_geojson/Leitstellen.json"; // Pfad anpassen
export function findLeitstelleForPosition(lat: number, lng: number) {
const heliPoint = point([lat, lng]);
for (const feature of (leitstellenGeoJSON as any).features) {
if (feature.geometry.type === "MultiPolygon") {
const polygon = multiPolygon(feature.geometry.coordinates);
if (booleanPointInPolygon(heliPoint, polygon)) {
console.log("Point is inside polygon:", feature.properties.name);
return feature.properties.name ?? "Unbenannte Leitstelle";
}
}
}
return null; // Keine passende Leitstelle gefunden
}

View File

@@ -1,2 +1,7 @@
export const checkSimulatorConnected = (date: Date) =>
date && Date.now() - new Date(date).getTime() <= 3000_000;
import { ConnectedAircraft } from "@repo/db";
export const checkSimulatorConnected = (a: ConnectedAircraft) => {
if (!a.lastHeartbeat || Date.now() - new Date(a.lastHeartbeat).getTime() > 30_000) return false; // 30 seconds
if (!a.posLat || !a.posLng) return false;
return true;
};