WMS Downloader
Downloads large georeferenced images from a WMS service in tiles and combines them into one virtual raster.
WMS services usually limit the size of a single image. wms-downloader splits a large bounding box into square tiles and downloads each tile with a separate GetMap request. It then creates a GDAL VRT file, which can be opened as one image in e.g. QGIS or converted with gdal_translate.
Setup
pip install wms-downloader # from PyPI
pip install git+https://github.com/codeforberlin/wms-downloader # directly from GitHub
Creating the VRT file requires gdalbuildvrt from GDAL, which needs to be installed separately, e.g. with brew install gdal or apt install gdal-bin.
Usage
Create a config.yml specifying your setup, e.g. for the true orthophotos of Berlin from 2024:
service:
version: 1.1.1
url: https://gdi.berlin.de/services/wms/truedop_2024
srs: EPSG:25833
format: jpeg
transparent: false
layer: truedop_2024
bbox:
west: 360000.0
south: 5790000.0
east: 420000.0
north: 5840000.0
size: 10000
resolution: 5000
timeout: 300
projection: EPSG:25833
directory: images
vrtfile: tiles.vrt
where:
servicedescribes the WMS service:versionis the WMS version,1.1.1or1.3.0,urlis the URL of the service, without query parameters,srsis the projection used for the requests,formatis the image format, e.g.jpegorpng, which is also used as file extension,transparentsets whether the background should be transparent (only forpng), andlayeris the name of the layer,
bboxis the bounding box for the map you want to retrieve, in the units ofprojection,sizeis the edge length of a single tile, in the units ofprojection,resolutionis the width and height of a single tile in pixels,timeoutis the timeout for a single request in seconds,projectionis the projection of the downloaded images and the VRT file,directoryis the directory where the downloaded images are stored, andvrtfileis the path to the created VRT file.
The example covers Berlin with 6 × 5 tiles of 10 × 10 km and 5000 × 5000 pixels, i.e. 30 requests with 2 m per pixel.
Then run the script with the config.yml as argument:
wms-downloader config.yml
Each tile is stored in directory as <west>_<south>_<resolution>.<format>, together with an .aux.xml file containing its georeference. Tiles which already have an .aux.xml file are skipped, so an interrupted download can simply be started again. The VRT file is only created if it does not exist yet, so delete it after downloading additional tiles.
Metadata
Release files for wms-downloader 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wms_downloader-1.2.0.tar.gz | 5.0 kB | Without provenance | Details for wms_downloader-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wms_downloader-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for wms_downloader-1.2.0-py3-none-any.whl |
Total release size: 10.4 kB
Release files / wms_downloader-1.2.0.tar.gz
| Download URL | wms_downloader-1.2.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77fd075aa6e35dbc0994653b75d4d9e903175a78da976ac2797ada2add9e4344
|
|
BLAKE2b-256 checksum How to use checksums |
70e8e880945e233acc3cc3be6d00b2b528668ad0311c2e4037e9dc2914fc77b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.8
|
Release files / wms_downloader-1.2.0-py3-none-any.whl
| Download URL | wms_downloader-1.2.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57c07cb5e9304cb375813d10fc35ec26e7fa405d7093a83c4724cc2d8e89fb0a
|
|
BLAKE2b-256 checksum How to use checksums |
6aaee091f6b695168be2a02843c911f235a201bcb038640e47ec20b8fe3b4b47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.8
|
Security for wms-downloader 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.