diff --git a/leafmap/common.py b/leafmap/common.py index 4f6d9661bc..3171d338fb 100644 --- a/leafmap/common.py +++ b/leafmap/common.py @@ -4666,7 +4666,7 @@ def netcdf_to_tif( if shift_lon: xds.coords[lon] = (xds.coords[lon] + 180) % 360 - 180 - xds = xds.sortby(xds.lon) + xds = xds.sortby(xds[lon]) allowed_vars = list(xds.data_vars.keys()) if isinstance(variables, str):