yujianshengucas的个人博客分享 http://blog.sciencenet.cn/u/yujianshengucas

博文

GDAL

已有 3734 次阅读 2015-9-25 11:12 |个人分类:小结|系统分类:科研笔记| GDAL, gdal_translate

参考:

http://www.gdal.org/gdal_merge.html

http://blog.163.com/lionyue@126/blog/static/10793071200710120467784/

http://seisman.info/srtm.html

http://www.csdn123.com/html/itweb/20131026/188804.htm

http://live.osgeo.org/zh/quickstart/gdal_quickstart.html


GDAL

使用 gdalinfo浏览影象

使用gdal_translate转换数据格式

使用 gdalwarp重投影

使用 gdal_warpgdal_merge.py拼接影象

使用 gdaltindex生成作为栅格切片索引的shp文件



gdal_translate工具可以用来在不同格式间转换栅格数据。并且在处理过程中暗地里做一些诸如子栅格设置,重采样和象元值集体变化等勾当。

EXAMPLE

gdal_translate -of GTiff -co "TILED=YES" utm.tif utm_tiled.tif


Starting with GDAL 1.8.0, to create a JPEG-compressed TIFF with internal mask from a RGBA dataset :

gdal_translate rgba.tif withmask.tif -b 1 -b 2 -b 3 -mask 4 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR --config GDAL_TIFF_INTERNAL_MASK YES


Starting with GDAL 1.8.0, to create a RGBA dataset from a RGB dataset with a mask :

gdal_translate withmask.tif rgba.tif -b 1 -b 2 -b 3 -b mask



gdal_merge.py镶嵌图像

该工具会自动镶嵌指定的图像。所有的图像必须具有相同的坐标系统和相同的波段数目;输入图像可能是有重叠区或者不同的分辨率。在重叠区部分最后的图像将会覆盖之前的图像值。

创建一个图像,将所有的波段都指定为255

%gdal_merge.py -init 255 -o out.tif in1.tif in2.tif

创建一个RGB图像,并将前两个波段初始化为0,第三个波段为255

%gdal_merge.py -init "0 0 255" -o out.tif in1.tif in2.tif


EXAMPLE

Create an image with the pixels in all bands initialized to 255.

% gdal_merge.py -init 255 -o out.tif in1.tif in2.tif

Create an RGB image that shows blue in pixels with no data. The first two bands will be initialized to 0 and the third band will be initialized to 255.

% gdal_merge.py -init "0 0 255" -o out.tif in1.tif in2.tif




https://blog.sciencenet.cn/blog-1094854-923286.html

上一篇:synth_offset.pl Culling points
下一篇:dem2diff.pl failed
收藏 IP: 27.17.57.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-22 06:48

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部