gdal2tiles
A python library for generating map tiles inspired by gdal2tiles.py from GDAL project.
Dependancies
GDAL development header files, sometimes available as libgdal-dev or libgdal-devel packages.
Installation
To install gdal2tiles library you can use pip:
$ pip install gdal2tiles
Basic usage
import gdal2tiles
gdal2tiles.generate_tiles('/path/to/input_file', '/path/to/output_dir/')
You can also pass various keyword as optional keyword arguments to generate_tiles() function. For example
gdal2tiles.generate_tiles('input_file', 'output_dir/', nb_processes=2, zoom='7-9')
OR
options = {'zoom': (7, 9), 'resume': True}
gdal2tiles.generate_tiles('input_file', 'output_dir/', **options)
In general
gdal2tiles.generate_tiles(input_file, output_folder, **options)
- Arguments:
input_file (str): Path to input file.
output_folder (str): Path to output folder.
options: Tile generation options.
- Options:
- profile (str): Tile cutting profile (mercator,geodetic,raster) - default
‘mercator’ (Google Maps compatible)
- resampling (str): Resampling method (average,near,bilinear,cubic,cubicsp
line,lanczos,antialias) - default ‘average’
s_srs: The spatial reference system used for the source input data
- zoom: Zoom levels to render; format: ‘[int min, int max]’,
‘min-max’ or ‘int/str zoomlevel’.
tile_size (int): Size of tiles to render - default 256
resume (bool): Resume mode. Generate only missing files.
srcnodata: NODATA transparency value to assign to the input data
- tmscompatible (bool): When using the geodetic profile, specifies the base
resolution as 0.703125 or 2 tiles at zoom level 0.
verbose (bool): Print status messages to stdout
- kml (bool): Generate KML for Google Earth - default for ‘geodetic’
profile and ‘raster’ in EPSG:4326. For a dataset with different projection use with caution!
url (str): URL address where the generated tiles are going to be published
- webviewer (str): Web viewer to generate (all,google,openlayers,none) -
default ‘all’
title (str): Title of the map
copyright (str): Copyright for the map
- googlekey (str): Google Maps API key from
bingkey (str): Bing Maps API key from https://www.bingmapsportal.com/
nb_processes (int): Number of processes to use for tiling.
History
0.1.9 (2020-09-30)
Enabling GDAL Exceptions.
Ensuring tmscompatible option in tile generation and calculation is bool instance.
0.1.8 (2020-09-23)
Fix AttributeError gdal2tiles.generate_tiles(..., profile='raster', kml=True). Fix issue #14.
0.1.7 (2020-06-03)
Add tile_size option on generate_tiles to allow custom tile sizes.
Small documentation updates.
Improve basic tests and test against multiple versions of GDAL.
0.1.6 (2020-01-03)
Fix some of GDAL installation issues.
Use pygdal package instead of GDAL dependency.
0.1.5 (2018-08-14)
Bug fix.
0.1.4 (2018-08-14)
Accept list or tuple in specifying tile generation zoom level.
0.1.3 (2018-07-31)
Use billard for multiprocessing if available.
0.1.2 (2018-05-16)
Bug fix in generate_tiles().
0.1.1 (2018-05-10)
Clean the source code.
Setup documentation
Setup testing environment
0.1.0 (2018-05-06)
First release on PyPI.
Metadata
Release files for gdal2tiles 0.1.9
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 | |
|---|---|---|---|---|
| gdal2tiles-0.1.9.tar.gz | 201.9 kB | Without provenance | Details |
Release files / gdal2tiles-0.1.9.tar.gz
| Download URL | gdal2tiles-0.1.9.tar.gz |
|---|---|
| Size | 201.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84b7ede6af85933501588a1238ba2214721d3c2a4a026f0b94e5eab992b86d42
|
|
BLAKE2b-256 checksum How to use checksums |
05123b23ccdd35c5c086aea415d048c7189970bb4003cdb8866793c22578a0b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2
|
Security for gdal2tiles 0.1.9
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.