GDAL工具之gdal2tiles

Stella981
• 阅读 1240

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. Int16UInt16,…) 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

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Easter79 Easter79
3年前
swap空间的增减方法
(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap
待兔 待兔
9个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Java修道之路,问鼎巅峰,我辈代码修仙法力齐天
<center<fontcolor00FF7Fsize5face"黑体"代码尽头谁为峰,一见秃头道成空。</font<center<fontcolor00FF00size5face"黑体"编程修真路破折,一步一劫渡飞升。</font众所周知,编程修真有八大境界:1.Javase练气筑基2.数据库结丹3.web前端元婴4.Jav
Wesley13 Wesley13
3年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
1年前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这
美凌格栋栋酱 美凌格栋栋酱
3个月前
Oracle 分组与拼接字符串同时使用
SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(