Skip to main content

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

tileclipper-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

tileclipper-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file tileclipper-1.0.0.tar.gz.

File metadata

  • Download URL: tileclipper-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for tileclipper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 91c632a908cdcb12af9105c9219d398498b26df94ba81ba7de494bdbabd31ace
MD5 ad0bfa9486a38060588f0e08ce87b40e
BLAKE2b-256 02e20293a74d52a3d87e54ba76e84c9c6cff803bea4eda5f302a89928c4342e5

See more details on using hashes here.

File details

Details for the file tileclipper-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tileclipper-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for tileclipper-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c68d7236c41fac344ae96145c36c1f143ab9b953b741c06ab590613a407bed95
MD5 a18316e6704715a825eb790bf1faa0a1
BLAKE2b-256 c2e2cd7027826c7d5168dc47eae50dc9c925c4a44ce1dfff0c786a3a2cbc045f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page