Hi I need For each Lat and Long value also the Alt value! However, I am having problems extracting these values from a Geotiff and wonder if this data is publicly available in Excel or CSV file format? Unfortunately I have not found anything myself!
my data: https://wetransfer.com/downloads/8e5ba7aa4cd8c406068a60543b353b0420220622084939/d3c744 For people who know Python:
import numpy as np
import 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