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
+27 -11
View File
@@ -7,7 +7,7 @@ const tours: TranslationStrings = {
'tours.mode.label': 'Zobrazení pro přidávání',
'tours.title': 'Výlety',
'tours.empty.title': 'Zatím žádné výlety',
'tours.empty.body': 'Začněte naplánováním výletu nebo importem souboru GPX.',
'tours.empty.body': 'Začněte naplánováním výletu nebo importem souboru GPX či KML.',
'tours.addToDay': 'Přidat ke dni',
'tours.addToDay.comingSoon': 'Přiřaďte výlety ke dni cesty ze seznamu výletů.',
'tours.addToDay.pickDay': 'Vyberte den',
@@ -20,22 +20,22 @@ const tours: TranslationStrings = {
'tours.caution.badge': 'používejte s opatrností',
'tours.caution.tooltip': 'Neúplné výškové údaje nebo metriky – importováno s výhradou',
'tours.import.caution': 'Importováno s výhradou – neúplné výškové údaje nebo metriky',
'tours.import.success': 'Z GPX bylo importováno {count} výletů',
'tours.import.success.one': 'Z GPX byl importován {count} výlet',
'tours.import.success.few': 'Z GPX byly importovány {count} výlety',
'tours.import.success': 'Importováno {count} výletů',
'tours.import.success.one': 'Importován {count} výlet',
'tours.import.success.few': 'Importovány {count} výlety',
'tours.import.noTrackIn': 'V souboru {name} nebyla nalezena stopa ani trasa',
'tours.import.errorIn': 'Soubor {name} se nepodařilo importovat',
'tours.import.button': 'Importovat GPX',
'tours.import.hint': 'Importujte soubory GPX jako výlety této cesty',
'tours.import.unsupported': 'Jako výlety lze importovat pouze soubory GPX.',
'tours.import.button': 'Importovat GPX nebo KML',
'tours.import.hint': 'Importujte soubory GPX, KML nebo KMZ jako výlety této cesty',
'tours.import.unsupported': 'Jako výlety lze importovat pouze soubory GPX, KML a KMZ.',
'tours.import.skipped': '{count} stop už v této cestě bylo, proto byly přeskočeny',
'tours.import.skipped.one': '{count} stopa už v této cestě byla, proto byla přeskočena',
'tours.import.skipped.few': '{count} stopy už v této cestě byly, proto byly přeskočeny',
'tours.import.allSkipped': 'Vše z tohoto souboru už v této cestě je.',
'tours.import.drop': 'Pusťte sem soubory GPX a importujte je',
'tours.import.drop': 'Pusťte sem soubory GPX, KML nebo KMZ a importujte je',
'tours.import.dropHint': 'Každá stopa nebo trasa v souboru se stane výletem této cesty.',
'tours.import.dropNoPermission': 'Do této cesty nemůžete přidávat výlety.',
'tours.import.importing': 'Importování GPX…',
'tours.import.importing': 'Importování…',
'tours.days.label': 'Dny cesty',
'tours.days.none': 'Zatím není přiřazen k žádnému dni cesty.',
'tours.days.short': 'Dny {days}',
@@ -99,7 +99,7 @@ const tours: TranslationStrings = {
'tours.planner.newTour': 'Naplánovat nový výlet',
'tours.planner.addTour': 'Přidat túru',
'tours.planner.addTourHint':
'Naplánuj novou túru, importuj soubory GPX nebo procházku z Google Maps, nebo převezmi túru z jiné cesty',
'Naplánuj novou túru, importuj soubory GPX nebo KML či procházku z Google Maps, nebo převezmi túru z jiné cesty',
'tours.planner.neutralTitle': 'Naplánovat výlet',
'tours.planner.neutralBody': 'Začněte novou túru a kliknutím do mapy umístěte její body.',
'tours.planner.newTitle': 'Nový výlet',
@@ -235,6 +235,7 @@ const tours: TranslationStrings = {
'tours.provenance.label': 'Původ',
'tours.provenance.source': 'Zdroj',
'tours.provenance.importedAt': 'Importováno',
'tours.provenance.fileImport': 'Import {format}',
'tours.provenance.createdAt': 'Vytvořeno',
'tours.provenance.externalUpdated': 'Změněno ve wanderer',
'tours.provenance.externalUpdatedHint': 'Datum změny, které wanderer uvedl při importu. Vodítko, ne důkaz verze.',
@@ -779,7 +780,7 @@ const tours: TranslationStrings = {
'tours.map.pisteStatic':
'Mapová data, ne zpravodajství: nic o tom, co je otevřené nebo upravené, o sněhu ani lavinách.',
'tours.map.pisteFullKey': 'Celá legenda na OpenSnowMap',
'tours.import.previewTitle': 'Náhled GPX',
'tours.import.previewTitle': 'Náhled importu',
'tours.import.previewHint': 'Zatím nic není uloženo. Zkontrolujte průběh a pak importujte.',
'tours.import.previewFiles': '{count} souborů',
'tours.import.previewFiles.one': '{count} soubor',
@@ -791,6 +792,21 @@ const tours: TranslationStrings = {
'tours.import.previewPoints.one': '{count} bod',
'tours.import.previewPoints.few': '{count} body',
'tours.import.previewNoHeights': 'V souboru nejsou výšky',
'tours.import.previewLeftOut': 'Neimportováno',
'tours.import.previewLeftOutHint':
'Výlety vznikají jen z čar. Špendlíky, plochy, překryvy a odkazy na jiné soubory zůstávají stranou a nic se nenačítá odjinud.',
'tours.import.leftOutPoints': '{count} špendlíků',
'tours.import.leftOutPoints.one': '{count} špendlík',
'tours.import.leftOutPoints.few': '{count} špendlíky',
'tours.import.leftOutAreas': '{count} ploch',
'tours.import.leftOutAreas.one': '{count} plocha',
'tours.import.leftOutAreas.few': '{count} plochy',
'tours.import.leftOutOther': '{count} dalších položek',
'tours.import.leftOutOther.one': '{count} další položka',
'tours.import.leftOutOther.few': '{count} další položky',
'tours.import.unreadableIn': 'Soubor {name} nelze přečíst: je poškozený nebo to není GPX, KML ani KMZ',
'tours.import.archiveNoKmlIn': 'V souboru {name} není žádný soubor KML',
'tours.import.archiveTooLargeIn': 'Soubor {name} je po rozbalení příliš velký',
'tours.import.previewDuplicate': 'Už je v cestě',
'tours.import.previewAllDuplicates': 'Všechny trasy už v cestě jsou, není co importovat.',
'tours.import.previewAs': 'Importovat jako',