|Version 2 (modified by klokan, 6 years ago)|
Manual page for gdal2tiles.py
NOTE: This manual page should be available soon on http://www.gdal.org/gdal2tiles.html
generates directory with TMS tiles, KMLs and simple web viewers
gdal2tiles.py [-title "Title"] [-publishurl http://yourserver/dir/] [-nogooglemaps] [-noopenlayers] [-nokml] [-googlemapskey KEY] [-forcekml] [-v] input_file [output_dir]
This utility generates a directory with small tiles and metadata, following OSGeo Tile Map Service Specification. Simple webpages with viewers based on Google Maps and OpenLayers? are generated as well - so anybody can comfortably explore your maps on-line and you do not need to install or configure any special software (like mapserver) and the map displays very fast in the webbrowser. You only need to upload generated directory into a webserver.
GDAL2Tiles creates also necessary metadata for Google Earth (KML SuperOverlay?), in case the supplied map uses EPSG:4326 projection.
World files and embeded georeference is used during tile generation, but you can publish a picture without proper georeference too.
All parameters are optional, but input_file. If output_dir is not specified then input_file without extension is used.
Title used for generated metadata, web viewers and KML files.
Address of a directory into which you are going to upload the result. It should end with slash.
Do not generate Google Maps based html page.
Do not generate OpenLayers? based html page.
Do not generate KML files for Google Earth.
Key for your domain generated on Google Maps API webpage ( http://www.google.com/apis/maps/signup.html).
Force generating of KML files. Input file must use EPSG:4326 coordinates!
Generate verbose output of tile generation.
NOTE: gdal2tiles.py is a Python script, and will only work if GDAL was built with Python support.
Usage tips and FAQ
Creating one KMZ file from generated structure
You need to zip (by zip, pkzip, WinZip?, ...) content of the generated directory the way, that doc.kml is directly available in the root of zip. Then rename .zip to .kmz and whole pyramid structure is available as one huge file. Google Earth should open such file without troubles.
If you need to publish the map online, it is better to upload generated structure directly as it was generated, then tiles are requested separately and users don't need to wait for dowload of the whole map. One huge KMZ is nice for CD-ROM distribution for example.
Why KML generator needs raster files with EPSG:4326 projection?
Google Earth expect raster tiles in this projection. You can use gdalwarp utility from GDAL (or FWTools) to warp your existing rasters into EPSG:4326. If you are sure, that your raster internally use correct coordinates, but gdal2tiles.py does not generate KML files, then use -forcekml parameter.
File with name doc.kml is generated always. It is for local computer usage and for KMZ. If you would like to generate Google Earth KML Superoverlay for distributing online, then specify -publishurl parameter and another kml file (with the file name same like output_dir) is generated. This KML file you can send by email or publicly linked, it should contain correct url for published tiles.
Can I use tiles as overlay on Google Maps?
Not yet. For this functionality TMS global-* profiles need to be implemented. It is on the TODO list (any support is welcome ;-)). If you would like to generate overlays from vector data, then use Mapnik Project
Project web site
This utility was created as project GDAL2Tiles in Google Summer of Code 2007.