標籤:level dev byte -- nsca usg mat off pci
GeoTiff 格式轉 GMT netCDF 格式
GDAL 提供了不少小工具,其中, gdal_translate
可用於網格資料的格式轉換。
GDAL 的安裝方法如下:
Ubuntu/Debian 下:
sudo apt-get install gdal-bin
CentOS/Fedora 下:
sudo yum install gdal
Windows 下,到 http://www.gisinternals.com/ 下載安裝包,安裝後命令位於 C:\Program Files (x86)\GDAL\gdal_translate.exe
。如果偶爾用一次,直接用 命令的完整路徑即可;如果經常使用,可以將 C:\Program Files (x86)\GDAL\
添加到環境變數 PATH 中
下面的命令可以將 GeoTiff 格式的資料轉換為 GMT 可識別的 netCDF 格式:
gdal_translate -of GMT srtm_56_05.tif srtm_56_05.nc
gdal_translate
的文法如下:
Usage: gdal_translate [--help-general] [--long-usage] [-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[_bn] [src_min src_max [dst_min dst_max]]]* [-exponent[_bn] exp_val]* [-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]]* [-mo"META-TAG=VALUE"]* [-q] [-sds] [-co"NAME=VALUE"]* [-stats] [-norat] src_dataset dst_dataset
-of
後接要轉換的資料格式,使用 gdal_translate --long-usage
可以看到,支援的格式如下:
VRT: Virtual RasterGTiff: GeoTIFFNITF: National Imagery Transmission FormatHFA: Erdas Imagine Images (.img)ELAS: ELASAAIGrid: Arc/Info ASCII GridDTED: DTED Elevation RasterPNG: Portable Network GraphicsJPEG: JPEG JFIFMEM: In Memory RasterGIF: Graphics Interchange Format (.gif)FITS: Flexible Image Transport SystemXPM: X11 PixMap FormatBMP: MS Windows Device Independent BitmapPCIDSK: PCIDSK Database FilePCRaster: PCRaster Raster FileILWIS: ILWIS Raster MapSGI: SGI Image File Format 1.0SRTMHGT: SRTMHGT File FormatLeveller: Leveller heightfieldTerragen: Terragen heightfieldGMT: GMT NetCDF Grid FormatnetCDF: Network Common Data FormatHDF4Image: HDF4 DatasetERS: ERMapper .ers LabelledJPEG2000: JPEG-2000 part 1 (ISO/IEC 15444-1)FIT: FIT ImageRMF: Raster Matrix FormatRST: Idrisi Raster A.1INGR: Intergraph RasterGSAG: Golden Software ASCII Grid (.grd)GSBG: Golden Software Binary Grid (.grd)R: R Object Data StorePNM: Portable Pixmap Format (netpbm)ENVI: ENVI .hdr LabelledEHdr: ESRI .hdr LabelledPAux: PCI .aux LabelledMFF: Vexcel MFF RasterMFF2: Vexcel MFF2 (HKV) RasterBT: VTP .bt (Binary Terrain) 1.3 FormatIDA: Image Data and AnalysisUSGSDEM: USGS Optional ASCII DEM (and CDED)ADRG: ARC Digitized Raster GraphicsBLX: Magellan topo (.blx)Rasterlite: RasterliteSAGA: SAGA GIS Binary Grid (.sdat)
GeoTiff 格式轉 GMT netCDF 格式(轉)