From 448004c05e83a7d78a6f659179c76a8aee915a13 Mon Sep 17 00:00:00 2001 From: Andrew Peace Date: Thu, 23 Jul 2026 21:50:15 +0100 Subject: [PATCH 1/2] Coverage: don't render tints when only one dataset The geotessera.org site assumes the older colourful legend is used, but when this tool renders coverage for v2 datasets it uses a tint per dataset. When there's only one data present it now defaults to the old swatch to match what geotessera.org expects. --- geotessera/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/geotessera/cli.py b/geotessera/cli.py index f90876a..333030b 100644 --- a/geotessera/cli.py +++ b/geotessera/cli.py @@ -1012,6 +1012,7 @@ def country_progress_callback(current: int, total: int, status: str = None): # Per-dataset GeoTessera instances. Reuse `gt` when its # (version, variant) matches a combo so we don't redownload. dataset_index = [] # entries that will land in coverage.json + logging.info(f"Exporting coverage for {len(datasets_to_export)} dataset(s)") for ds in datasets_to_export: if ( ds["dataset_version_path"] == gt.registry._version_path @@ -1043,7 +1044,7 @@ def country_progress_callback(current: int, total: int, status: str = None): ds_gt.generate_coverage_texture( coverage_data, output_file=str(texture_path), - tint_color=ds["color"], + tint_color=ds["color"] if len(datasets_to_export) > 1 else None, ) dataset_index.append( From 175c28297f47298bbf4e4b233605113162686e2f Mon Sep 17 00:00:00 2001 From: Andrew Peace Date: Thu, 23 Jul 2026 22:11:55 +0100 Subject: [PATCH 2/2] Correct globe coverage legend for one or many variants. Previously the tool always used the tint mode, but the prior commit changed this to use the old legend style to match the website when only a single variant was present. This change fixes the legend rendered by the CLI tool to match: use the old non-tint version when one variant is present, otherwise use the tints as before. --- geotessera/cli.py | 74 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 16 deletions(-) diff --git a/geotessera/cli.py b/geotessera/cli.py index 333030b..dc5b3ad 100644 --- a/geotessera/cli.py +++ b/geotessera/cli.py @@ -2687,35 +2687,77 @@ def _get_globe_html_template() -> str: function renderLayerToggles() { const root = document.getElementById('layerList'); root.innerHTML = ''; - for (const ds of datasets) { + + // For single dataset, show temporal legend (multi-color scheme fixed by texture); + // for multiple datasets, show tint-variant legend (color gradient per dataset). + const isSingleDataset = datasets.length === 1; + + if (isSingleDataset) { + // Temporal variant: show the fixed temporal coverage colors + const ds = datasets[0]; const id = `ds_${ds.id}`; - const [r, g, b] = ds.color; - const colorRgb = `rgb(${r},${g},${b})`; - // Shade scale mirrors the server-side rendering: tiles with - // 1/N years are blended 50% toward white; tiles with N/N - // years stay at full tint. Show the gradient inline so the - // legend self-documents what the on-globe shades mean. - const palest = `rgb(${Math.round(r*0.5+255*0.5)},${Math.round(g*0.5+255*0.5)},${Math.round(b*0.5+255*0.5)})`; - const gradient = `linear-gradient(90deg, ${palest}, ${colorRgb})`; - const totalYears = ds.years.length; const wrap = document.createElement('div'); wrap.style.cssText = 'margin:8px 0;'; + + // Legend entries for temporal coverage scheme + const legendItems = [ + { color: '#00c800', label: 'Full coverage' }, + { color: '#00b4ff', label: 'Multi-year' }, + { color: '#ffc800', label: 'Latest year' }, + { color: '#c86400', label: 'Older years' }, + { color: '#666666', label: 'No coverage' }, + ]; + wrap.innerHTML = ` -