Skip to main content

gdal2tiles

https://img.shields.io/pypi/v/gdal2tiles.svg https://img.shields.io/travis/tehamalab/gdal2tiles.svg Documentation Status

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.

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

http://code.google.com/apis/maps/signup.html

bingkey (str): Bing Maps API key from https://www.bingmapsportal.com/

nb_processes: Number of processes to use for tiling.

History

0.1.0 (2018-05-06)

  • First release on PyPI.

0.1.1 (2018-05-10)

  • Clean the source code.

  • Setup documentation

  • Setup testing environment

0.1.2 (2018-05-16)

  • Bug fix in generate_tiles().

0.1.3 (2018-07-31)

  • Use billard for multiprocessing if available.

0.1.4 (2018-08-14)

  • Accept list or tuple in specifying tile generation zoom level.

0.1.5 (2018-08-14)

  • Bug fix.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygdal2tiles-0.1.9.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygdal2tiles-0.1.9-py2.py3-none-any.whl (34.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pygdal2tiles-0.1.9.tar.gz.

File metadata

  • Download URL: pygdal2tiles-0.1.9.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for pygdal2tiles-0.1.9.tar.gz
Algorithm Hash digest
SHA256 dcf138a0d0f595e85cafb6a945c4cb8cac3257cecf812e9dd80ef2b80a25adaa
MD5 0f60f72af236e7c9c4ae79a273904699
BLAKE2b-256 d2c2c3836d588d1114196dfd3eed5f36cea88b71b0dd6083c6c513e3cfd04746

See more details on using hashes here.

File details

Details for the file pygdal2tiles-0.1.9-py2.py3-none-any.whl.

File metadata

  • Download URL: pygdal2tiles-0.1.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for pygdal2tiles-0.1.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 60119fe1db4f59708681482c2c217507764550ac43a1e03e2c0c751990d039be
MD5 092c5c0351b2501761bec0cfc3f507d6
BLAKE2b-256 16319008c4302a5e4cc90273fd1ed2ccc23a5bfa9f31d535354ba47c6f06aef5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.5

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page