Hello,
I am trying to plot a GPX track on top of a DEM surface using plotly:
This is my code:
fig.add_surface(z=alt, x=lat, y=lon, colorscale='Earth', reversescale=True, lighting=lighting_effects, lightposition=dict(x=df['Longitude'].min(), y=df['Latitude'].min(), z=ele_max))
fig.add_scatter3d(x=df_gpx['latitude'],
y=df_gpx['longitude'],
z=df_gpx['elevation'],
mode='lines', line=dict(width=8))
fig.update_layout(width=width, height=height,
scene=dict(xaxis = dict(title='lat', showbackground=False), yaxis = dict(title='lon', showbackground=False), zaxis = dict(title='alt', range=[ele_min, ele_max], showbackground=False)))
The problem is that the coordinates of the track (in red) are not at all on the DEM surface, in spite of the fact that the altitude data is extracted from the same geotiff file in both cases.
It looks like a problem of scaling, but I cannot figure out what is wrong.