feat(tours): import KML and KMZ routes as tours, with a preview first

A route planned in Google My Maps or Google Earth can now become a tour
without converting it to GPX first. The import button and a file dropped on
the tours workspace take .kml and .kmz files beside .gpx, through the same
preview, the same import routes and the same transaction as a GPX file.

The preview shows every line of the file on its own, numbered, with its
distance and heights; two lines of one placemark are numbered after its name
and never joined. Heights count only where they are heights: kept for an
absolute line, dropped for any other altitude mode and for the all-zero
placeholder My Maps writes, so a missing height stays unknown. What the file
holds besides its lines (pins, areas, overlays, links to other files) is
counted in a dashed card, and nothing is fetched from elsewhere.

The KML reading reuses the place import's codec. A KMZ only ever has its KML
entry unpacked, counted byte by byte against the decompressed cap whatever
its header claims. A file that cannot be read is refused with its reason
(damaged, an archive without KML, too large unpacked), and the toast names
the file and the reason. A KML or KMZ import keeps the gpx origin of a file
import; its provenance names the real format from the stored file name.
This commit is contained in:
Maurice
2026-10-20 12:28:57 +02:00
parent f57a0dbd31
commit 3659297af1
58 changed files with 1883 additions and 400 deletions
+24 -10
View File
@@ -7,7 +7,7 @@ const tours: TranslationStrings = {
'tours.mode.label': 'Ansicht zum Hinzufügen',
'tours.title': 'Touren',
'tours.empty.title': 'Noch keine Touren',
'tours.empty.body': 'Plane eine Tour oder importiere eine GPX-Datei.',
'tours.empty.body': 'Plane eine Tour oder importiere eine GPX- oder KML-Datei.',
'tours.addToDay': 'Zum Tag hinzufügen',
'tours.addToDay.comingSoon': 'Ordne Touren über die Tourenliste einem Reisetag zu.',
'tours.addToDay.pickDay': 'Tag auswählen',
@@ -20,20 +20,20 @@ const tours: TranslationStrings = {
'tours.caution.badge': 'mit Vorsicht verwenden',
'tours.caution.tooltip': 'Höhendaten oder Streckenwerte unvollständig – mit Vorsicht importiert',
'tours.import.caution': 'Mit Vorsicht importiert – Höhendaten oder Streckenwerte unvollständig',
'tours.import.success': '{count} Touren aus GPX importiert',
'tours.import.success.one': '{count} Tour aus GPX importiert',
'tours.import.success': '{count} Touren importiert',
'tours.import.success.one': '{count} Tour importiert',
'tours.import.noTrackIn': 'Keine Strecke oder Route in {name} gefunden',
'tours.import.errorIn': '{name} konnte nicht importiert werden',
'tours.import.button': 'GPX importieren',
'tours.import.hint': 'GPX-Dateien als Touren dieser Reise importieren',
'tours.import.unsupported': 'Nur GPX-Dateien können als Touren importiert werden.',
'tours.import.button': 'GPX oder KML importieren',
'tours.import.hint': 'GPX-, KML- oder KMZ-Dateien als Touren dieser Reise importieren',
'tours.import.unsupported': 'Nur GPX-, KML- und KMZ-Dateien können als Touren importiert werden.',
'tours.import.skipped': '{count} Strecken waren schon in dieser Reise und wurden übersprungen',
'tours.import.skipped.one': '{count} Strecke war schon in dieser Reise und wurde übersprungen',
'tours.import.allSkipped': 'Alles aus dieser Datei ist schon in dieser Reise.',
'tours.import.drop': 'GPX-Dateien hier ablegen, um sie zu importieren',
'tours.import.drop': 'GPX-, KML- oder KMZ-Dateien hier ablegen, um sie zu importieren',
'tours.import.dropHint': 'Jede Strecke oder Route in einer Datei wird zu einer Tour dieser Reise.',
'tours.import.dropNoPermission': 'Du kannst dieser Reise keine Touren hinzufügen.',
'tours.import.importing': 'GPX wird importiert…',
'tours.import.importing': 'Wird importiert…',
'tours.days.label': 'Reisetage',
'tours.days.none': 'Noch an keinem Tag der Reise.',
'tours.days.short': 'Tage {days}',
@@ -99,7 +99,7 @@ const tours: TranslationStrings = {
'tours.planner.newTour': 'Neue Tour planen',
'tours.planner.addTour': 'Tour hinzufügen',
'tours.planner.addTourHint':
'Neue Tour planen, GPX-Dateien oder einen Walk aus Google Maps importieren oder eine Tour aus einer anderen Reise übernehmen',
'Neue Tour planen, GPX- oder KML-Dateien oder einen Walk aus Google Maps importieren oder eine Tour aus einer anderen Reise übernehmen',
'tours.planner.neutralTitle': 'Tour planen',
'tours.planner.neutralBody': 'Starte eine neue Tour und klicke auf die Karte, um die Wegpunkte zu setzen.',
'tours.planner.newTitle': 'Neue Tour',
@@ -239,6 +239,7 @@ const tours: TranslationStrings = {
'tours.provenance.label': 'Herkunft',
'tours.provenance.source': 'Quelle',
'tours.provenance.importedAt': 'Importiert',
'tours.provenance.fileImport': '{format}-Import',
'tours.provenance.createdAt': 'Angelegt',
'tours.provenance.externalUpdated': 'Geändert bei wanderer',
'tours.provenance.externalUpdatedHint':
@@ -800,7 +801,7 @@ const tours: TranslationStrings = {
'tours.map.pisteStatic':
'Kartendaten, kein Lagebericht: nichts dazu, was offen oder präpariert ist, zu Schnee oder Lawinen.',
'tours.map.pisteFullKey': 'Ganze Legende bei OpenSnowMap',
'tours.import.previewTitle': 'GPX-Vorschau',
'tours.import.previewTitle': 'Import-Vorschau',
'tours.import.previewHint': 'Noch ist nichts gespeichert. Prüfe den Verlauf, dann importieren.',
'tours.import.previewFiles': '{count} Dateien',
'tours.import.previewFiles.one': '{count} Datei',
@@ -809,6 +810,19 @@ const tours: TranslationStrings = {
'tours.import.previewPoints': '{count} Punkte',
'tours.import.previewPoints.one': '{count} Punkt',
'tours.import.previewNoHeights': 'Keine Höhen in der Datei',
'tours.import.previewLeftOut': 'Nicht importiert',
'tours.import.previewLeftOutHint':
'Touren entstehen nur aus Linien. Pins, Flächen, Overlays und Verweise auf andere Dateien bleiben draußen, und nichts wird von anderswo geladen.',
'tours.import.leftOutPoints': '{count} Pins',
'tours.import.leftOutPoints.one': '{count} Pin',
'tours.import.leftOutAreas': '{count} Flächen',
'tours.import.leftOutAreas.one': '{count} Fläche',
'tours.import.leftOutOther': '{count} weitere Elemente',
'tours.import.leftOutOther.one': '{count} weiteres Element',
'tours.import.unreadableIn':
'{name} konnte nicht gelesen werden: Die Datei ist beschädigt oder kein GPX, KML oder KMZ',
'tours.import.archiveNoKmlIn': 'Keine KML-Datei in {name} gefunden',
'tours.import.archiveTooLargeIn': '{name} ist entpackt zu groß',
'tours.import.previewDuplicate': 'Schon in der Reise',
'tours.import.previewAllDuplicates': 'Alle Tracks sind schon in der Reise, es gibt nichts zu importieren.',
'tours.import.previewAs': 'Importieren als',