Modifiy xaxis and yaxis' values to UTM coordinates values

Hi,
I followed this example.“3D Surface Plots in Pandas”. I created my own 3d Dem.
But I want to modifiy xaxis and yaxis’ values to UTM coordinates values.

I couldn’t do that.
Can you give me hint. ?

kind regards

There’s no easy way to do that at the moment. But you can try setting layout.scene.xaxis.tickvals and layout.scene.xaxis.ticktext.

1 Like

Because UTM coords could potentially have a large number of non-significant digits you could subtract offsets from your x and y coordinates.

Then add the offset as part of the x and y axis labels (see image). Finally, you can add the offset to the x and y in the text fields so that hover shows the actual UTM .
coords. Selection_015

1 Like

hi,
thank you. I did like this and the result looks OK for me.

#using GDAL and utm libs


#The return has the form (EASTING, NORTHING, ZONE NUMBER, ZONE LETTER).
geominYXutm = utm.from_latlon(geominY,geominX)
geomaxYXutm = utm.from_latlon(geomaxY,geomaxX)

xminutm = float(geominYXutm[0] )
yminutm = float(geominYXutm[1] )

xmaxutm = float(geomaxYXutm[0] )
ymaxutm = float(geomaxYXutm[1] )

xutm = np.arange(xminutm, xmaxutm , geotransform[1]).astype(int)
yutm = np.arange(yminutm, ymaxutm , geotransform[1]).astype(int)

dem is from readasarray of GDAL and numpy

df= pd.DataFrame(dem)
trace1 = go.Surface(x=xutm , y=yutm ,z=df.values.tolist(),colorscale=‘Earth’)