1GDAL2TILES(1) GDAL GDAL2TILES(1)
2
3
4
6 gdal2tiles - Generates directory with TMS tiles, KMLs and simple web
7 viewers.
8
10 gdal2tiles.py [-p profile] [-r resampling] [-s srs] [-z zoom]
11 [-e] [-a nodata] [-v] [-q] [-h] [-k] [-n] [-u url]
12 [-w webviewer] [-t title] [-c copyright]
13 [--processes=NB_PROCESSES] [--xyz]
14 --tilesize=PIXELS
15 [-g googlekey] [-b bingkey] input_file [output_dir] [COMMON_OPTIONS]
16
18 This utility generates a directory with small tiles and metadata, fol‐
19 lowing the OSGeo Tile Map Service Specification. Simple web pages with
20 viewers based on Google Maps, OpenLayers and Leaflet are generated as
21 well - so anybody can comfortably explore your maps on-line and you do
22 not need to install or configure any special software (like MapServer)
23 and the map displays very fast in the web browser. You only need to up‐
24 load the generated directory onto a web server.
25
26 GDAL2Tiles also creates the necessary metadata for Google Earth (KML
27 SuperOverlay), in case the supplied map uses EPSG:4326 projection.
28
29 World files and embedded georeferencing is used during tile generation,
30 but you can publish a picture without proper georeferencing too.
31
32 NOTE:
33 Inputs with non-Byte data type (i.e. Int16, UInt16,...) will be
34 clamped to the Byte data type, causing wrong results. To avoid this
35 it is necessary to rescale input to the Byte data type using
36 gdal_translate utility.
37
38 NOTE:
39 Config options of the input drivers may have an effect on the output
40 of gdal2tiles. An example driver config option is GDAL_PDF_DPI,
41 which can be found at configoptions
42
43 -p <PROFILE>, --profile=<PROFILE>
44 Tile cutting profile (mercator, geodetic, raster) - default
45 'mercator' (Google Maps compatible).
46
47 Starting with GDAL 3.2, additional profiles are available from
48 tms_XXXX.json files placed in GDAL data directory (provided all
49 zoom levels use same origin, tile dimensions, and resolution be‐
50 tween consecutive zoom levels vary by a factor of two).
51
52 -r <RESAMPLING>, --resampling=<RESAMPLING>
53 Resampling method (average, near, bilinear, cubic, cubicspline,
54 lanczos, antialias, mode, max, min, med, q1, q3) - default 'av‐
55 erage'.
56
57 -s <SRS>, --s_srs=<SRS>
58 The spatial reference system used for the source input data.
59
60 --xyz Generate XYZ tiles (OSM Slippy Map standard) instead of TMS. In
61 the default mode (TMS), tiles at y=0 are the southern-most
62 tiles, whereas in XYZ mode (used by OGC WMTS too), tiles at y=0
63 are the northern-most tiles.
64
65 New in version 3.1.
66
67
68 -z <ZOOM>, --zoom=<ZOOM>
69 Zoom levels to render (format:'2-5', '10-' or '10').
70
71 -e, --resume
72 Resume mode. Generate only missing files.
73
74 -a <NODATA>, --srcnodata=<NODATA>
75 Value in the input dataset considered as transparent. If the in‐
76 put dataset had already an associate nodata value, it is over‐
77 ridden by the specified value.
78
79 -v, --verbose
80 Generate verbose output of tile generation.
81
82 -x, --exclude
83 Exclude transparent tiles from result tileset.
84
85 -q, --quiet
86 Disable messages and status to stdout
87
88 New in version 2.1.
89
90
91 --processes=<NB_PROCESSES>
92 Number of parallel processes to use for tiling, to speed-up the
93 computation.
94
95 New in version 2.3.
96
97
98 --tilesize=<PIXELS>
99 Width and height in pixel of a tile. Default is 256.
100
101 New in version 3.1.
102
103
104 -h, --help
105 Show help message and exit.
106
107 --version
108 Show program's version number and exit.
109
110 KML (Google Earth) options
111 Options for generated Google Earth SuperOverlay metadata
112
113 -k, --force-kml
114 Generate KML for Google Earth - default for 'geodetic' profile
115 and 'raster' in EPSG:4326. For a dataset with different projec‐
116 tion use with caution!
117
118 -n, --no-kml
119 Avoid automatic generation of KML files for EPSG:4326.
120
121 -u <URL>, --url=<URL>
122 URL address where the generated tiles are going to be published.
123
124 Web viewer options
125 Options for generated HTML viewers a la Google Maps
126
127 -w <WEBVIEWER>, --webviewer=<WEBVIEWER>
128 Web viewer to generate (all, google, openlayers, leaflet, mapml,
129 none) - default 'all'.
130
131 -t <TITLE>, --title=<TITLE>
132 Title of the map.
133
134 -c <COPYRIGHT>, --copyright=<COPYRIGHT>
135 Copyright for the map.
136
137 -g <GOOGLEKEY>, --googlekey=<GOOGLEKEY>
138 Google Maps API key from
139 http://code.google.com/apis/maps/signup.html.
140
141 -b <BINGKEY>, --bingkey=<BINGKEY>
142 Bing Maps API key from https://www.bingmapsportal.com/
143
144 NOTE:
145 gdal2tiles.py is a Python script that needs to be run against Python
146 GDAL binding.
147
148 MapML options
149 MapML support is new to GDAL 3.2. When --webviewer=mapml is specified,
150 --xyz is implied, as well as --tmscompatible if --profile=geodetic.
151
152 The following profiles are supported:
153
154 • mercator: mapped to OSMTILE MapML tiling scheme
155
156 • geodetic: mapped to WGS84 MapML tiling scheme
157
158 • APSTILE: from the tms_MapML_APSTILE.json data file
159
160 The generated MapML file in the output directory is mapml.mapl
161
162 Available options are:
163
164 --mapml-template=<filename>
165 Filename of a template mapml file where variables will be sub‐
166 stituted. If not specified, the generic template_tiles.mapml
167 file from GDAL data resources will be used
168
169 The --url option is also used to substitute ${URL} in the template
170 MapML file.
171
173 Basic example:
174
175 gdal2tiles.py --zoom=2-5 input.tif output_folder
176
177 MapML generation:
178
179 gdal2tiles.py --zoom=16-18 -w mapml -p APSTILE --url "https://example.com" input.tif output_folder
180
182 Klokan Petr Pridal <klokan@klokan.cz>
183
185 1998-2022
186
187
188
189
190 May 04, 2022 GDAL2TILES(1)