Linux command
gdal2tiles.py 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Generate tiles from
gdal2tiles.py [input.tif] [output_dir]
Specify zoom levels
gdal2tiles.py -z [5-18] [input.tif] [output_dir]
Generate for Leaflet
gdal2tiles.py -w leaflet [input.tif] [output_dir]
Use multiple processes
gdal2tiles.py --processes=[4] [input.tif] [output_dir]
Specify tile format
gdal2tiles.py --tileformat=[png] [input.tif] [output_dir]
说明
gdal2tiles.py generates map tiles from georeferenced raster images. It creates tile pyramids compatible with web mapping libraries like Leaflet and OpenLayers. The tool produces XYZ or TMS tile structures with optional HTML viewer pages. It handles large images by generating multiple zoom levels with appropriate resampling. gdal2tiles.py enables serving large geospatial imagery as web map tiles.
参数
- -z _LEVELS_
- Zoom levels (e.g., 5-18).
- -w _WEBVIEWER_
- Web viewer: leaflet, openlayers, none.
- --processes _N_
- Parallel processing.
- --tileformat _FORMAT_
- Tile format: png, jpeg, webp.
- --help
- Display help information.
FAQ
What is the gdal2tiles.py command used for?
gdal2tiles.py generates map tiles from georeferenced raster images. It creates tile pyramids compatible with web mapping libraries like Leaflet and OpenLayers. The tool produces XYZ or TMS tile structures with optional HTML viewer pages. It handles large images by generating multiple zoom levels with appropriate resampling. gdal2tiles.py enables serving large geospatial imagery as web map tiles.
How do I run a basic gdal2tiles.py example?
Run `gdal2tiles.py [input.tif] [output_dir]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -z _LEVELS_ do in gdal2tiles.py?
Zoom levels (e.g., 5-18).