Gdaltranslate命令解析

Gdaltranslate命令解析
Gdal translate
在不同的格式间进⾏转换。同时潜在的执⾏了⼀些切割,重采样,和使像素⽐例变化的任务。
⽤法
gdal_translate [--help-general]
[-ot
{Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/CInt16/CInt32/CFloat3 2/CFloat64}]
[-not_strict]
[-of format] [-b band] [-outsize xsize[%] ysize[%]]
[-scale [src_min src_max [dst_min dst_max]]]
[-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry]
[-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value] [-gcp pixel line easting northing [elevation]]*
[-mo "META-TAG=VALUE"]* [-quiet] [-sds]
[-co "NAME=VALUE"]* src_dataset dst_dataset
参数解释
-ot:type 设置输出波段数据的数据类型。
-strict 或-not_strict 是否对不匹配和丢失数据宽⼤处理,当在进⾏输出时
骑马机-of format 设置输出的格式,默认的是GTiff,设置时,只需格式的简称。
-b band 选择要输出的波段。波段是从1 ⾄多,开始编号。-b 可以⽤来选择⼏个要输出的波段,也可以对波段顺序进⾏重排。
-outsize xsize[%] ysize[%] 设置输出的⽂件⼤⼩(像素),如果⽤%则表⽰按百分⽐。?-scale [src_min src_max [dst_min dst_max]] 重新组织输⼊象元的值。将它们从src_min~src_max 范围内缩放到dst_min ~ dst_max 范围内。如果省略,输出范围将为0~255。输⼊范围将由源数据⾃动计算。
-
srcwin xoff yoff xsize ysize 选择⼀个取值窗⼝,通过该窗⼝在原图像中的⾏列位置来拷贝数值。
手动抽油泵-projwin ulx uly lrx lry 选择⼀个地理范围来选择,通过该窗⼝在原图像中地理坐标范围来拷贝数据。ulx uly lrx lry 分别代表西,北,东,南。
-a_srs srs_def 重写输出的⽂件的投影。srs_def 可以是任何常⽤的GDAL/OGR格式,WKT,Proj4,EPSG:n 或者⼀个包含着wkt 的⽂件的⽂件名。
-a_ullr ulx uly lrx lry 指定或重写输出⽂件的地理边界范围,⽽不去参考原图像的边界范围。
-a_nodata value 指定⼀个⽆意义的值到输出波段。联合签名
-mo "META-TAG=VALUE" 如果可能的话通过设置输出数据的原数据名称和其值。
-co "NAME=VALUE" 通过⼀个创建参数来指定输出格式特殊创建要求。多个-co 参数可以组合起来使⽤。创建参数可以参考个个数据格式本⾝说明。
-gcp pixel line easting northing [elevation] 添加指定地⾯控制点到输出数据集。这个参数可能被提供多次以提供⼀系列的GCPs
-quiet 忽略处理进程监视和其他不是错误的输出。
-sds 拷贝⽂件中所有⼦数据集到各⾃的输出⽂件中。通常这个参数⽤在HDF或者OGDI 这样有⼦数据集的格式中。
src_dataset 源栅格数据⽂件名
dst_dataset 输出栅格数据⽂件名
例⼦
将GeoTiff格式转换为ENVI格式
$gdal_translate -of ENVI /media/ddata/p133r034utm20000810/a30.tif a30
Input file size is 8614, 7746
<10...20...30...40...50...60...70...80...90...100 - done.
gdal_translate
converts raster data between different formats
SYNOPSIS
gdal_translate [--help-general]
[-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-strict]
[-of format] [-b band] [-mask band] [-expand {gray|rgb|rgba}]
[-outsize xsize[%] ysize[%]]
[-unscale] [-scale [src_min src_max [dst_min dst_max]]]
[-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry] [-epo] [-eco] [-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
[-gcp pixel line easting northing [elevation]]*
DESCRIPTION
The gdal_translate utility can be used to convert raster data between different formats, potentially performing some operations like subsettings, resampling, and rescaling pixels in the process.
-ot: type
For the output bands to be of the indicated data type.
-strict:
Do'nt be forgiving of mismatches and lost data when translating to the output format. -of format:
Select the output format. The default is GeoTIFF (GTiff). Use the short format name. -b band:
Select an input band band for output. Bands are numbered from 1.
Multiple -b switches may be used to select a set of input bands to write to the output file, or to reorder bands. Starting with GDAL 1.8.0, band can also be set to "mask,1"
(or just "mask") to mean the mask band of the 1st band of the input dataset.
-mask band:
(GDAL >= 1.8.0) Select an input band band to create output dataset mask band.
Bands are numbered from 1. band can be set to "none" to avoid copying the global mask of the input dataset if it exists. Otherwise it is copied by default ("auto"), unless the mask is an alpha channel, or if it is explicitely used to ben a regular band of the output dataset ("-b mask"). band can also be set to "mask,1" (or just "mask") to mean the mask band of the 1st band of the input dataset.
-expand gray|rgb|rgba:
(From GDAL 1.6.0) To expose a dataset with 1 band with a color table as a dataset with 3 (RGB) or 4 (RGBA) bands. Usefull for output drivers such as JPEG, JPEG2000, MrSID, ECW that don't support color indexed datasets. The 'gray' value (from GDAL
1.7.0) enables to expand a dataset with a color table that only contains gray levels to
a gray indexed dataset.
-outsize xsize[%] ysize[%]:
Set the size of the output file. Outsize is in pixels and lines unless '%' is attached in which case it is as a fraction of the input image size.
-scale [src_min src_max [dst_min dst_max]]:
Rescale the input pixels values from the range src_min to src_max to the range dst_min to dst_max. If omitted the output range is 0 to 255. If omitted the input range is automatically computed from the source data.
-unscale:
Apply the scale/offset metadata for the bands to convert scaled values to unscaled
values. It is also often necessary to reset the output datatype with the -ot switch. -srcwin xoff yoff xsize ysize:
Selects a subwindow from the source image for copying based on pixel/line location. -projwin ulx uly lrx lry:
Selects a subwindow from the source image for copying (like -srcwin) but with the corners given in georeferenced coordinates.
-epo: (Error when Partially Outside)
(GDAL >= 2.0) If this option is set, -srcwin or -projwin values that falls partially outside the source raster extent will be considered as an error. The default behaviour starting with GDAL 2.0 is to accept such requests, when they were considered as an error before.
-eco: (Error when Completely Outside)
(GDAL >= 2.0) Same as -epo, except that the criteron for erroring out is when the request falls completely outside the source raster extent.
-a_srs srs_def:
Override the projection for the output file. The srs_def may be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a file containing the WKT.
-a_ullr ulx uly lrx lry:
Assign/override the georeferenced bounds of the output file. This assigns georeferenced bounds to the output file, ignoring what would have been derived from the source file.
-a_nodata value:
Assign a specified nodata value to output bands. Starting with GDAL 1.8.0, can be set to none to avoid setting a nodata value to the output file if one exists for the source file
-mo "META-TAG=VALUE":
Passes a metadata key and value to set on the output dataset if possible.
-co "NAME=VALUE":
Passes a creation option to the output format driver. Multiple -co options may be listed. See format specific documentation for legal creation options for each format. -gcp pixel line easting northing elevation:
大功率led光源Add the indicated ground control point to the output dataset. This option may be provided multiple times to provide a set of GCPs.
-q:
Suppress progress monitor and other non-error output.
-sds:
Copy all subdatasets of this file to individual output files. Use with formats like HDF or OGDI that have subdatasets. -stats:
(GDAL >= 1.8.0) Force (re)computation of statistics.
src_dataset:
压力检测装置
The source dataset name. It can be either file name, URL of data source or subdataset name for multi-dataset files. dst_dataset:
The destination file name.
桥梁建设EXAMPLE
Starting with GDAL 1.8.0, to create a JPEG-compressed TIFF with internal mask from a RGBA dataset :
Starting with GDAL 1.8.0, to create a RGBA dataset from a RGB dataset with a mask :

本文发布于:2024-09-21 22:47:48,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/4/148216.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:输出   数据   波段
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议