gdal2tiles
Generates directory with TMS tiles, KMLs and simple web viewers.
使用 TMS tiles、 KMLs 和简单的 web 查看器生成目录。
Synopsis 大纲
gdal2tiles**.**py [**-**p profile] [**-**r resampling] [**-**s srs] [**-**z zoom] [**-**e] [**-**a nodata] [**-**v] [**-**q] [**-**h] [**-**k] [**-**n] [**-**u url] [**-**w webviewer] [**-**t title] [**-**c copyright] [**--processes=**NB_PROCESSES] [**-**g googlekey] [**-**b bingkey] input_file [output_dir]
Description 描述
This utility generates a directory with small tiles and metadata, following the OSGeo Tile Map Service Specification. Simple web pages with viewers based on Google Maps, OpenLayers and Leaflet 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 web browser. You only need to upload the generated directory onto a web server.
这个实用程序按照 OSGeo Tile Map Service Specification 生成一个带有小块和元数据的目录。 简单的网页与浏览器基于谷歌地图,OpenLayers 和Leaflet生成,因此任何人都可以舒适地浏览您的地图在线,你不需要安装或配置任何特殊软件(如 MapServer)和地图显示非常快速的网页浏览器。 你只需要上传生成的目录到一个网络服务器上。
GDAL2Tiles also creates the necessary metadata for Google Earth (KML SuperOverlay), in case the supplied map uses EPSG:4326 projection.
Gdal2tiles 还为 Google Earth (KML SuperOverlay)创建必要的元数据,以防所提供的地图使用 EPSG: 4326投影。
World files and embedded georeferencing is used during tile generation, but you can publish a picture without proper georeferencing too.
在平铺生成过程中使用 World 文件和嵌入式地理引用,但是您也可以在没有适当地理引用的情况下发布图片。
Note 注意
Inputs with non-Byte data type (i.e. Int16
, UInt16
,…) will be clamped to the Byte
data type, causing wrong results. To awoid this it is necessary to rescale input to the Byte
data type using gdal_translateutility.
具有非字节数据类型的输入(即 Int16,UInt16,...)将被限制到 Byte 数据类型,导致错误的结果。 为了实现这一点,必须使用 gdal translate 工具对 Byte 数据类型的输入重新进行标准化。
-p
<PROFILE>``,
--profile``=<PROFILE>
Tile cutting profile (mercator, geodetic, raster) - default ‘mercator’ (Google Maps compatible).
平铺切割配置文件(墨卡托,大地测量,光栅)-默认的‘墨卡托’(谷歌地图兼容)。
-r
<RESAMPLING>``,
--resampling``=<RESAMPLING>
Resampling method (average, near, bilinear, cubic, cubicspline, lanczos, antialias, mode, max, min, med, q1, q3) - default ‘average’.
重采样方法(average,near,billinear,cubicspline,lanczos,antialias,mode,max,min,med,q1,q3)-默认的“ average”。
-s
<SRS>``,
--s_srs``=<SRS>
The spatial reference system used for the source input data.
用于源输入数据的空间参考系统。
-z
<ZOOM>``,
--zoom``=<ZOOM>
Zoom levels to render (format:‘2-5’ or ‘10’).
缩放级别以渲染(格式: “2-5”或“10”)。
-e``,
--resume
Resume mode. Generate only missing files.
恢复模式。只生成丢失的文件。
-a
<NODATA>``,
--srcnodata``=<NODATA>
NODATA transparency value to assign to the input data.
要分配给输入数据的 NODATA 透明度值。
-v``,
--verbose
Generate verbose output of tile generation.
生成瓦片过程的详细输出。
-q``,
--quiet
Disable messages and status to stdout
禁用消息和标准输出状态
New in version 2.1.
新版本2.1。
--processes``=<NB_PROCESSES>
Number of processes to use for tiling.
用于瓦片的进程数。
New in version 2.3.
新版本2.3。
-h``,
--help
Show help message and exit.
显示帮助信息并退出。
--version
Show program’s version number and exit.
显示程序的版本号并退出。
KML (Google Earth) options Kml (Google Earth)选项
Options for generated Google Earth SuperOverlay metadata
生成 Google Earth SuperOverlay 元数据的选项
-k``,
--force-kml
Generate KML for Google Earth - default for ‘geodetic’ profile and ‘raster’ in EPSG:4326. For a dataset with different projection use with caution!
为 Google Earth 生成 KML —— EPSG 中“大地测量”和“光栅”的默认值: 4326。 对于具有不同投影的数据集,请谨慎使用!
-n``,
--no-kml
Avoid automatic generation of KML files for EPSG:4326.
避免为 EPSG: 4326自动生成 KML 文件。
-u
<URL>``,
--url``=<URL>
URL address where the generated tiles are going to be published.
将要发布生成的图片的 URL 地址。
Web viewer options 网页浏览器选项
Options for generated HTML viewers a la Google Maps
生成 HTML 查看器的选项就像谷歌地图一样
-w
<WEBVIEWER>``,
--webviewer``=<WEBVIEWER>
Web viewer to generate (all, google, openlayers, leaflet, none) - default ‘all’.
网页浏览器生成(所有,谷歌,开放层,传单,没有)-默认“所有”。
-t
<TITLE>``,
--title``=<TITLE>
Title of the map.
地图标题。
-c
<COPYRIGHT>``,
--copyright``=<COPYRIGHT>
Copyright for the map.
地图版权所有。
-g
<GOOGLEKEY>``,
--googlekey``=<GOOGLEKEY>
Google Maps API key from http://code.google.com/apis/maps/signup.html.
来自 Google http://code.Google.com/apis/Maps/signup.html 的 Google Maps API 键。
-b
<BINGKEY>``,
--bingkey``=<BINGKEY>
Bing Maps API key from https://www.bingmapsportal.com/
来自 https://www.bingmapsportal.com/ 的 Bing Maps API key
Note****注意
gdal2tiles.py is a Python script that needs to be run against Python GDAL binding.
Gdal2tiles.py 是一个需要针对 Python GDAL 绑定运行的 Python 脚本。
Examples 例子
Basic example:
基本例子:
gdal2tiles**.**py **--zoom=2-5 input.**tif output_folder