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
}