The `TileClipper` package enables users to download map tiles within a specified bounding box from a tile server
Project description
TileClipper Package Usage Guide
Introduction
The TileClipper
package enables users to download map tiles within a specified bounding box from a tile server. This guide illustrates the installation process, instantiation of the TileClipper
class, and downloading map tiles using the package.
Installation
Ensure Python is installed on your system, then install the TileClipper
package using pip
:
pip install tileclipper
from tileclipper import TileClipper
Instantiate TileClipper
Define the required parameters for the TileClipper class:
base_url (str): Base URL of the tile server.
bbox (list): Bounding box coordinates [minx, miny, maxx, maxy].
output_folder (str): Directory to save downloaded tiles.
max_workers (int, optional): Maximum number of concurrent workers for tile downloads (default is 10).
Create an instance of the TileClipper class:
base_url = "https://example.com/tiles/" # Replace with your tile server URL
bbox = [xmin, ymin, xmax, ymax] # Replace with bounding box coordinates
output_folder = "/path/to/output/folder/" # Replace with output folder path
max_workers = 10 # Optional: Set maximum workers for concurrent downloads
tileclipper = TileClipper(base_url, bbox, output_folder, max_workers)
Download Tiles
Utilize the download_tiles(zoom_start, zoom_end) method to download tiles within a specified zoom level range:
# Download tiles within zoom level range 18 to 20
tileclipper.download_tiles(18, 20)
Example
Here's an example demonstrating the usage of the TileClipper class:
from tileclipper import TileClipper
base_url = "https://example.com/tiles/"
bbox = [xmin, ymin, xmax, ymax]
output_folder = "/path/to/output/folder/"
max_workers = 10
tileclipper = TileClipper(base_url, bbox, output_folder, max_workers)
tileclipper.download_tiles(18, 20)
Replace the placeholder values (base_url, bbox, output_folder, etc.) with your specific values according to your use case.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tileclipper-0.8.tar.gz
.
File metadata
- Download URL: tileclipper-0.8.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fc972456364746a271fbdab0b925ba4d77b5cff667a068872b80ef65c0fe8b8 |
|
MD5 | bfe9657f8fce100a65f7221c0e9780eb |
|
BLAKE2b-256 | bf3ecda2400a9b3df869e0867594e722d5e2c58890ad97dded67e066c3d8ee13 |