参考seisman http://seisman.info/convert-geotiff-to-gmt.html
目的
画**地区地形图
特点小范围高精度
试验数据两种
(一)SRTM 3弧秒 90米
1 从网页下载
http://srtm.csi.cgiar.org/SRT-ZIP/SRTM_V41/SRTM_Data_GeoTiff/srtm_61_07.zip
http://srtm.csi.cgiar.org/SRT-ZIP/SRTM_V41/SRTM_Data_GeoTiff/srtm_61_07.zip
2 GDAL grd数据拼接
gdal_merge.py -init 255 -o out.tif srtm_60_07.tif srtm_61_07.tif
%输出的名称必须是out.tif
3 GDAL格式转换 tif2grd
gdal_translate -of GMT out.tif ningde.grd
4 gmt画图
(二)ASTER GDEM 1弧秒 30米
ubuntu安装sudo apt-get install gdal-bin
gdal_translate -of GMT ASTGTM2_N28E121_dem .tif ASTGTM2_N28E121_dem.grd
gmt画图代码
参考seisman http://seisman.info/convert-geotiff-to-gmt.html
下面的命令可以将 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 Raster
GTiff: GeoTIFF
NITF: National Imagery Transmission Format
HFA: Erdas Imagine Images (.img)
ELAS: ELAS
AAIGrid: Arc/Info ASCII Grid
GSAG: Golden Software ASCII Grid (.grd)
GSBG: Golden Software Binary Grid (.grd)
JPEG: JPEG JFIF
BT: VTP .bt (Binary Terrain) 1.3 Format
IDA: Image Data and Analysis
USGSDEM: USGS Optional ASCII DEM (and CDED)
ADRG: ARC Digitized Raster Graphics
BLX: Magellan topo (.blx)
Rasterlite: Rasterlite
SAGA: SAGA GIS Binary Grid (.sdat)