Fetch map tiles from WMS server and store them with WMTS convention
Project description
wms-tile-get
Fetch map tiles from WMS server and store them with WMTS convention. Typically the resulting tiles should be with EPSG:3857 projection.
The tool is similar to many others like wms-tiles-downloader but accept also geojson polygon as an area of interest.
Install
$ pip install wms-tile-get
Usage
Fetch tiles for an area (e.g. a city)
$ cd example/
$ wms-tile-get -s by_wms.json \
-g munich.boundary.geojson \
-z 10 \
-o by_dop80c
-s
defines WMS server parameters.
-g
defines the area(s) of interest (polygon area in geojson).
-z
defines the zoom level(s) of interest.
-o
defines output folder.
An area or boundary shapes (e.g. munich.boundary.geojson
) of named areas can be downloaded from
boundary.now.
Fetch tiles for a bbox area
$ wms-tile-get -s by_wms.json \
-b 11.43,48.11,11.63,48.26 \
-z 10 \
-o by_dop80c
-b
defines bounding box with longitudes and latitudes coordinates (i.e. EPSG:4326)
More example
fetch tiles for zoom level 1 to 5, and 10 and 13. All tiles will be fetched again when the tiles already exist in the output folder.
$ wms-tile-get -s by_wms.json \
-g munich.boundary.geojson \
-z 1-5 10 13 \
-o by_dop80c \
--force
Requirement:
- Python
- requests
- supermercado
- mercantile
Extra example
We can also only generate tile information with [x, y, z, minx, miny, maxx, maxy] tuples representing WMTS tile id and bbox.
$ cat munich.boundary.geojson \
| supermercado burn 18 \
| mercantile shapes --mercator \
| jq -c -r '[ [.id[1:-1]|split(",")|.[]|tonumber], .bbox ] | flatten | join(" ")' \
> munich.tiles.bbox.z18.txt
The result munich.tiles.bbox.z18.txt
looks like:
139445,90854,18,1280014.4756635614,6148135.933089867,1280167.3497201318,6148288.807146437
139446,90854,18,1280167.3497201318,6148135.933089867,1280320.223776702,6148288.807146437
139447,90854,18,1280320.223776702,6148135.933089867,1280473.0978332725,6148288.807146437
139448,90854,18,1280473.0978332725,6148135.933089867,1280625.971889843,6148288.807146437
139449,90854,18,1280625.971889843,6148135.933089867,1280778.8459464132,6148288.807146437
...
and then we can fetch tiles with such tile information.
$ wms-tile-get -s by_wms.json \
-t munich.tiles.bbox.z10.txt \
-o by_dop80c
-t
defines tile information input file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wms-tile-get-0.2.tar.gz
.
File metadata
- Download URL: wms-tile-get-0.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d19740cc783b28bb46a4541cfca9497b316ada05127abbaef00a56fbfa95af4a |
|
MD5 | 9a792f6ea01b0a56f509b415cda2c39d |
|
BLAKE2b-256 | 7e9305cb8fe0541e09bf18d087083dadbc59c16ef1fd6a54a41d3d3ce0b7b85b |
File details
Details for the file wms_tile_get-0.2-py3-none-any.whl
.
File metadata
- Download URL: wms_tile_get-0.2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5bcf8b91e077d552a07cc54079531e5ba7fe4f04619ad1c461909c80caf1237 |
|
MD5 | 5b96572781e48ea2d142b65f5eab69cf |
|
BLAKE2b-256 | 648fdeffcefcff0657604c3055d75397c55b48ad0e804906a22bc82000df7bef |