https://github.com/sijandh35/tileclipper
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.
https://github.com/sijandh35/tileclipper
cliptiles geo geolocation gettilesbyboundary python3 rastertile tileclipper tileclippers tileserver
Last synced: about 1 year ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/sijandh35/tileclipper
- Owner: sijandh35
- License: gpl-3.0
- Created: 2024-01-16T05:24:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T07:57:48.000Z (almost 2 years ago)
- Last Synced: 2025-04-12T17:54:36.137Z (about 1 year ago)
- Topics: cliptiles, geo, geolocation, gettilesbyboundary, python3, rastertile, tileclipper, tileclippers, tileserver
- Language: Python
- Homepage: https://pypi.org/project/tileclipper/
- Size: 49.8 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 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`:
```sh
pip install tileclipper
```
```python
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:
```python
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:
```python
# 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:
```python
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.