- Grounding Line
U.S. NATIONAL ICE CENTER USNIC_ANTARC_shelf_2022
下载下来是shp文件,里面坐标系是WGS84的XY坐标系。
要转换为lon lat坐标:
1)online
MyGeodata Converter
好处是很直接,坏处是一天可能最多只能免费转换一次
2)gdal — a translator library for raster and vector geospatial data formats
gdal里有个函数ogr2ogr专门用来转换文件格式 比如shp转成gmt之类的
ogr2ogr -f GMT -t_srs EPSG:4326 to.gmt from.shp
EPSG:4326就是WGS84 lon lat的代码
详细参考gdal ogr2ogr
GMT官方手册上也有ogr2ogr
- Remote Sensing
EarthExplorer
下载Landsat8的RGB geotiff遥感图像数据后,需要做一定的预处理才能用GMT绘制。参考了yangleir的博客。不过我的数据下载下来就是Byte格式的,只需要转一下坐标系就行了,从XY转成latlon。推荐下载数据后用gdalinfo命令看一下数据头文件,有坐标系,投影,范围,波段之类的。
gdalwarp -t_srs EPSG:4326 name.tif name_wgs.tif
GMT中:
+b0,1,2是按R,G,B顺序读入数据并叠加,画出来的图才正常。另外-Q就是把-NaN的数据点都画成透明的,不然就是黑色的,不方便两张遥感图像叠加。
R=74/78/-70/-68.5
J=M76.5/-69.5/12c
gmt begin 0104 pdf
gmt set FONT_ANNOT_PRIMARY 8p,Helvetica,black
gmt grdimage 0104_1.tif+b0,1,2 -J$J -Q
gmt grdimage 0104_2.tif+b0,1,2 -J$J -Q
gmt basemap -R$R -J$J -Baf -BSWNE -Lg77.25/-69.9+jBL+c-69.9+w20k+f+u
gmt end show
- Antarctica topography data
2-m spatial resolution: REMA
The file is a tiff dataset, with the coordinate of WGS 84 / Antarctic Polar Stereographic (EPSG:3031) (Unit: m). Thus, I first use gdal to convert it to WGS 84/4326:
gdalwarp -s_srs EPSG:3031 -t_srs EPSG:4326 36_52_1_2_2m_v2.0_dem.tif REMA.nc
Or the pixel size can be given:
gdalwarp -tr 0.000045 0.000045 -s_srs EPSG:3031 -t_srs EPSG:4326 36_52_1_2_2m_v2.0_dem.tif REMA.nc # -tr dx dy (Unit: degree)
- lon, lat 2 utm (Universal Transverse Mercator, a specific coordinate system commonly used in California)
import pyproj
nad27utm = pyproj.Proj(proj="utm", zone='11', datum='WGS84', ellps='WGS84', preserve_unites=False)
M1 = (-117.504, 35.705, 10.5); M2 = (-117.599, 35.770, 8.0)
M1_x, M1_y = nad27utm(M1[0], M1[1])