How to visualize a HGT file (i.e. a Shuttle Radar Topography Mission or SRTM data file, https://dwtkns.com/srtm30m/) with hvplot?

Hi there,

I’m trying to visualize a HGT file (i.e. a Shuttle Radar Topography Mission or SRTM data file, https://dwtkns.com/srtm30m/). I’ve tried a few different methods, but they all don’t work unfortunately (various different error messages):

data = xr.open_rasterio("SOME.hgt")
data.hvplot.quadmesh(x="x", y="y", z="band", geo=True, rasterize=True)
data.sel(band=1).hvplot.quadmesh(x="x", y="y", geo=True, rasterize=True)
data.sel(band=1).hvplot.image(x="x", y="y", z="band")

Any help greatly appreciated, many thanks! (I tried to upload an example file to make a reproduction easier, but unfortunately discourse didn’t like it.)

Maybe
https://hvplot.holoviz.org/reference/xarray/rgb.html

1 Like

It turns out the data needed some preprocessing, in particular hvplot didn’t like the original tuple units format (("m",):

data = xr.open_rasterio("SOME.hgt")
data.attrs["units"] = "m"

da.sel(band=1).hvplot.image(x="x", y="y", geo=True)
1 Like

Could you file an issue with HoloViews about the unit tuples? We should handle those.

1 Like