Files
geograsim/App/php/fix-waypoints-2.php
T
Adminator 1e51ef7def Nachtrag: alle bisher untracked Ordner + hängende Änderungen mit-committen
- Konzept/, didaktik_geografie/, didaktik_simulation/, v2-modules/, v2-platform/
- 12 code-workspace-Files
- STATUS-*.md
- viele M/D/R-Änderungen an bereits getrackten Files
- .gitignore verstärkt: **/.humaninput/, **/secret_keys.txt

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-08 02:27:02 +02:00

35 lines
1.4 KiB
PHP

<?php
/**
* Base-Korrekturen aus dem Audit vom 2026-04-19 (Runde 2).
* Quelle: OSM/Nominatim, gezielte Queries für Christophorus-Stützpunkte.
*/
require_once __DIR__ . '/config/app.php';
require_once __DIR__ . '/config/db.php';
$corrections = [
['nenzing', 47.20900, 9.66000, 'C8 Nenzing — Notarzt-Heli Luftrettungstation, Galinastraße'],
['hohenems', 47.38440, 9.69930, 'Flugplatz Hohenems-Dornbirn LOIH, Lustenauer Ried'],
['innsbruck', 47.25970, 11.34190, 'C1 Innsbruck — Flughafen Innsbruck'],
['kitzbuehel_c4', 47.48870, 12.36480, 'C4 — Notarzt-Heli Luftrettungstation Reith bei Kitzbühel'],
];
$db = getDB();
$stmt = $db->prepare("UPDATE geo_waypoints SET lat=?, lon=? WHERE wp_key=?");
$log = [];
foreach ($corrections as [$key, $lat, $lon, $note]) {
$before = $db->prepare("SELECT lat, lon FROM geo_waypoints WHERE wp_key=?");
$before->execute([$key]);
$old = $before->fetch();
$stmt->execute([$lat, $lon, $key]);
$log[] = [
'wp_key' => $key,
'note' => $note,
'old' => $old ? [(float)$old['lat'], (float)$old['lon']] : null,
'new' => [$lat, $lon],
'rows_updated' => $stmt->rowCount(),
];
}
header('Content-Type: application/json; charset=utf-8');
echo json_encode(['ok' => true, 'applied' => count($log), 'log' => $log], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);