< p >嗨我需要为每个纬度和经度值的Alt值!然而,我从Geotiff提取这些值有问题,不知道这个数据是公开在Excel或CSV文件格式?不幸的是我还没有找到任何我自己!< / p > < p >我的数据:< a href = " https://wetransfer.com/downloads/8e5ba7aa4cd8c406068a60543b353b0420220622084939/d3c744 " rel = " nofollow noreferrer " > https://wetransfer.com/downloads/8e5ba7aa4cd8c406068a60543b353b0420220622084939/d3c744 < / >的人知道Python: < / p > < pre > <代码>进口numpy np matplotlib进口。pyplot as plt from netCDF4 import Dataset import pandas as pd data = Dataset("C:/Users/Oliver Weisser/Desktop/Bachelor/Programm/Daten/Daten/ETOPO1_Bed_g_gdal.grd",'r') print(data.variables.keys()) lon_range = data.variables['x_range'][:] lat_range = data.variables['y_range'][:] topo_range = data.variables['z_range'][:] spacing = data.variables['spacing'][:] dimension = data.variables['dimension'][:] z = data.variables['z'][:] lon_num = dimension[0] lat_num = dimension[1] lon = np.linspace(lon_range[0],lon_range[1],dimension[0]) lat = np.linspace(lat_range[0],lat_range[1],dimension[1]) topo = np.reshape(z, (lat_num, lon_num)) dfl = pd.DataFrame({ 'Latitude': lat.reshape(-1), 'Longitude': lon.reshape(-1), 'Altitude': topo.reshape(-1) }) print(dfl) Source: ETOPO1 region selection (in python)
This is the code I have written so far, maybe someone will find a bug there