[general]
name=Basemap Tile Downloader
qgisMinimumVersion=3.40.8
description=Download a WMS, WMTS, or XYZ basemap over an extent and mosaic it into a GeoTIFF.
about=Auto-detects whether the chosen layer is a WMS, WMTS, or XYZ tile source. Tiles the request over a chosen extent (WMS GetMap at a chosen resolution/CRS, or WMTS / Web-Mercator {z}/{x}/{y} at a chosen zoom), downloads with adaptive throttling and a resumable SQLite work queue, georeferences each tile, and builds a compressed, tiled GeoTIFF mosaic (with overviews) using GDAL. Optionally reprojects to a chosen output CRS and crops to the exact extent. Requires the GDAL Python bindings. For personal and educational use only — respect each provider's Terms of Service and usage limits.
version=1.5.0
author=Coert Vonk
email=ing.c.j.s.vonk@gmail.com
license=GPL-3.0-or-later
tracker=https://github.com/cvonk/qgis-basemap-tile-downloader/issues
repository=https://github.com/cvonk/qgis-basemap-tile-downloader
homepage=https://github.com/cvonk/qgis-basemap-tile-downloader
icon=icon.svg
experimental=False
deprecated=False
supportsQt6=True
category=Raster
tags=wms,wmts,xyz,tiles,download,raster,mosaic,gdal,basemap,orthophoto,aoi,web mercator
changelog=1.5.0 - QGIS 4 / Qt 6 support: the plugin now runs on QGIS 4.2 as well
    as QGIS 3.40+ from a single codebase (scoped Qt enums, supportsQt6=True).
    Note QGIS 4 uses a separate profile root (see the README install notes).
    1.4.22 - Fully-transparent tiles are kept and mosaicked like any other
    tile. The cache stores relative file paths, so a job folder can be
    moved/restored elsewhere and still resume (existing absolute-path caches
    still work). GeoTIFF exports at its true native resolution. Fixes: resuming
    no longer re-requests known-empty tiles (saves a quota tile); stopping on the
    per-run budget or cancel keeps the in-flight fetches instead of re-fetching;
    the inter-cell rest only fires on forward progress.
    1.4.21 - A local raster (GeoTIFF) is read/exported, not downloaded, and
    the wording now reflects that (the Task Manager entry reads "Basemap raster
    export"; the log and message bar say read/export). Dialog tweaks: the
    tile-count estimate sits with the size controls (under the Zoom level for
    XYZ), and Reproject sampling now comes before Output CRS. Refreshed the
    screenshot and README.
    1.4.20 - Dialog reorganized into collapsible groups (Extent + crop,
    Tile size & resolution, Output). For a GeoTIFF source the Tile size &
    resolution group is collapsed and greyed (it exports at native resolution),
    and the Advanced options and tile-count estimate are greyed out. New
    confirmation prompt before overwriting an existing output file.
    1.4.19 - Auto-migrate a pre-1.4.18 flat cache into the new per-job
    folder on the next run of the same job, so an interrupted download resumes
    without re-downloading.
    1.4.18 - Polite mode for rate-limited servers: tiles are fetched by
    walking an 8x8 grid of macro-cells (so an interrupted run leaves a contiguous
    area), a new "Stop after N tiles this run" budget lets you fill a daily-quota
    server over several days via resume, and an optional rest after each cell
    eases short-term burst limits. Each job now caches in its own subdirectory,
    so a different download no longer wipes an in-progress one.
    1.4.17 - Added a "Reset to defaults" button to the Advanced options.
    Removed the non-functional "Draw on Canvas" button from the extent selector.
    1.4.16 - Removed the .flake8 config from the plugin package (a hidden
    file inside the package is flagged as suspicious). It stays at the repo root
    for local dev and CI only.
    1.4.15 - Ship the .flake8 config inside the plugin package so the QGIS
    Plugin Repository's Flake8 Code Quality check honours it. Added bandit
    (security) and detect-secrets scanning to the CI check-in.
    1.4.14 - Flake8 code-quality cleanups (renamed an ambiguous loop
    variable, fixed inline-comment and comma spacing) plus a .flake8 config
    documenting the plugin's intentional compact style. No behavior change.
    1.4.13 - Hardened parsing of remote WMS/WMTS GetCapabilities and
    ServiceException XML against entity-expansion (billion laughs) and
    external-entity (XXE) attacks, via a dependency-free safe parser. No change
    for valid responses (WMS 1.1.1 DOCTYPEs still parse).
    1.4.12 - Added a LICENSE file inside the plugin package, required by
    the QGIS Plugin Repository.
    1.4.11 - Fixed metadata.txt so it parses on the QGIS Plugin Repository
    (removed literal percent signs the repository's parser rejected).
    1.4.10 - First public release on the QGIS Plugin Repository.
    1.4.9 - A message-bar notice appears when the fetch phase ends and the
    mosaic build begins ("All tiles fetched — building the GeoTIFF mosaic…"), so
    the completed progress bar isn't mistaken for a stall. Declared the plugin license
    (GPL-3.0-or-later) in metadata.
    1.4.8 - Renamed the cache folder btd_cache/ to __btdcache__/
    (Python __pycache__ style). Clearer mosaic-build error messages. The WMTS
    zoom control shows a tile-matrix index instead of a misleading m/px figure.
    README refreshed (Advanced back-off/give-up options, circuit breaker, log
    panel, sync.ps1).
    1.4.7 - The task progress bar no longer sits frozen at the last
    fetch percentage while the mosaic is built, including after a
    cancel. It jumps to the end when the fetch phase ends and clears once done.
    1.4.6 - A resumed run no longer grinds for hours when a provider
    refuses a block of tiles (every request failing with the throttle pinned at
    its cap). A run-level circuit breaker stops after ~10 min of no successes,
    builds a partial mosaic, and leaves the rest pending for a later re-run. New
    Advanced options: back-off cap, and give-up threshold (0 = never).
    1.4.5 - Starting a download now raises QGIS's Log Messages panel (the
    Basemap Tile Downloader tab) so the live run log is visible without hunting.
    1.4.4 - Moved the menu entry from Web to Raster (category is now
    Raster). Added a note that the plugin is for personal/educational use only and
    to respect provider Terms of Service, plus a Q&A on NaN extents from
    "Calculate from Layer" (a layer CRS mismatch — reproject that layer).
    1.4.3 - New "Minimum delay between requests" advanced option (default
    0). The mosaic is now always built from whatever downloaded, including after a
    cancel, so gaps show which tiles are missing. Persistently-broken tiles give
    up faster (back-pressure budget 8, backoff cap 30s).
    1.4.2 - WMS ServiceExceptions (transient server draw failures) are now
    retried with back-off on the back-pressure budget instead of failing fast, so
    intermittent provider glitches recover far more often. Repeated error messages
    in the log are collapsed (full once, then "repeat xN", with an end-of-run
    tally).
    1.4.1 - The dialog title bar now shows the plugin version (and, from a
    git checkout, the short commit hash).
    1.4.0 - Local raster (GeoTIFF/GDAL) layers can now be used as the
    source: read over the extent and reprojected/cropped like the tile sources
    (single-band rasters keep their nodata instead of gaining an alpha band).
    A resumed run re-fetches 'done' tiles whose cached file went missing. Clearer
    end-of-run log ("Queue drained: N of M …", a warning when tiles failed).
    1.3.2 - download.log is truncated at the start of each run (no longer
    grows unbounded). Server rate-limiting is now logged explicitly (reason,
    HTTP status, Retry-After, new pacing, and back-pressure retry count).
    1.3.1 - Dialog remembers and restores the last-used extent. Extent
    widget shown as separate, clearly-labelled fields (readable with a comma
    decimal separator) in a collapsible group. Throttle/timeout responses retried
    on a separate budget and a server Retry-After is honoured, so rate-limiting no
    longer fails good tiles. Suppressed QGIS's redundant task-ended notification.
    Cache folder renamed to btd_cache/.
    1.3.0 - Raised the minimum QGIS to 3.40.8. Fixed request timeouts
    (now honoured and retried instead of being mistaken for empty tiles) and
    Retry-After date parsing. WMTS shows the large-download/ToS confirmation;
    XYZ zoom is clamped to the layer's range. Moved "Crop output to the exact
    extent" up under the extent selector. Renamed the per-job working folder to
    basemap_tile_downloader/ (an interrupted aoi_download/ run won't auto-resume).
    1.2.1 - Renamed the plugin package folder to basemap_tile_downloader
    (the installed plugin id changed to match).
    1.2.0 - Renamed to Basemap Tile Downloader. Download area is now a
    rectangular extent selector (was an AOI polygon layer). Configurable parallel
    downloads and max attempts in a collapsible Advanced section; re-runs retry
    previously-failed tiles.
    1.1.1 - Terms-of-Service reminder on large downloads; XYZ resolution
    label reported at the AOI latitude.
    1.1.0 - WMTS source backend; optional clip-to-AOI-polygon (cutline);
    release-zip automation; ruff lint and more unit tests.
    1.0.0 - Combined WMS + XYZ download to clipped GeoTIFF: auto-detected source,
    resumable queue, adaptive per-source throttling, parallel fetching, GDAL
    mosaic with selectable resampling/optional reprojection, tile-count estimate,
    and completion feedback. See CHANGELOG.md for details.
