gdal gdal2tiles.py 的使用

本文介绍了如何使用GDAL的gdal2tiles.py工具将地图图像转换为地图瓦片,适用于Google Earth和OpenLayers。通过下载GDAL,获取图像信息,地理校正,瓦片创建等步骤,展示了生成Natural Earth II地图切片的详细过程。
摘要由CSDN通过智能技术生成

I’m here showing how you can use GDAL2Tiles to generate map tiles of Tom Patterson’s Natural Earth II. This is a beautiful raster map that portrays the world environment in an idealised manner with little human influence. The map can be downloaded on this page. I’m here using version 2C.

I start by using gdal_translate to georeference the map image:

 

gdal_translate -a_srs EPSG:4326 -gcp 0 0 -180 90 -gcp 16200 0 180 90 -gcp 16200 8100 180 -90 NE2_modis3.jpg NE2_modis3.tif


The image should now have the correct projection (EPSG:4326), but GDAL2Tiles was not generating the KML SuperOverlay before ran this command:
 

gdalwarp -t_srs EPSG:4326 NE2_modis3.tif NE2_modis3_4326.tif


The original raster map is 16,200 x 8,100 pixels. Each map tile image is 256 x 256 pixels. This table shows the number of tiles generated for each zoom level:

For my purpose, 5 zoom levels are enough. I therefore reduced the map image to 8192 x 4096 pixels:
 

gdal_translate -outsize 8192 4096 NE2_modis3_4326.tif NE2_modis3_4326_5.tif


Finally, I used GDAL2Tiles to generate the map tiles:
 

gdal2tiles -title "Natural Earth II" -publishurl http://www.thematicmapping.org/maptiles/ -v NE2_modis3_4326_5.tif naturalearth

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值