File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 33:class:`xarray.DataArray`.
44"""
55
6+ import contextlib
67from typing import Literal
78
89from packaging .version import Version
1617 TileProvider = None
1718 _HAS_CONTEXTILY = False
1819
20+ with contextlib .suppress (ImportError ):
21+ # rioxarray is needed to register the rio accessor
22+ import rioxarray # noqa: F401
23+
1924import numpy as np
2025import xarray as xr
2126
@@ -117,6 +122,10 @@ def load_tile_map(
117122 * y (y) float64 ... -7.081e-10 -7.858e+04 ... -1.996e+07 -2.004e+07
118123 * x (x) float64 ... -2.004e+07 -1.996e+07 ... 1.996e+07 2.004e+07
119124 spatial_ref int64 ... 0
125+ >>> # CRS is set only if rioxarray is available
126+ >>> if hasattr(raster, "rio"):
127+ ... raster.rio.crs
128+ CRS.from_epsg(3857)
120129 """
121130 if not _HAS_CONTEXTILY :
122131 raise ImportError (
You can’t perform that action at this time.
0 commit comments