Skip to content

Commit

Permalink
simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Nov 5, 2024
1 parent 544f000 commit 2b33241
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geoviews/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,9 @@ def from_xarray(da, crs=None, apply_transform=False, nan_nodata=False, **kwargs)
elif hasattr(da, 'rio') and da.rio.crs is not None:
# rioxarray.open_rasterio
crs = None
for n in ("to_epsg", "to_proj4"):
for fn in (da.rio.crs.to_epsg, da.rio.crs.to_proj4):
with suppress(Exception):
crs = process_crs(getattr(da.rio.crs, n)())
crs = process_crs(fn())
break
if crs:
kwargs['crs'] = crs
Expand Down

0 comments on commit 2b33241

Please sign in to comment.