File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 16
16
TileProvider = None
17
17
_HAS_CONTEXTILY = False
18
18
19
+ try :
20
+ import rioxarray # rioxarray is needed to register the rio accessor # noqa: F401
21
+
22
+ _HAS_RIOXARRAY = True
23
+ except ImportError :
24
+ _HAS_RIOXARRAY = False
25
+
19
26
import numpy as np
20
27
import xarray as xr
21
28
@@ -117,6 +124,11 @@ def load_tile_map(
117
124
* y (y) float64 ... -7.081e-10 -7.858e+04 ... -1.996e+07 -2.004e+07
118
125
* x (x) float64 ... -2.004e+07 -1.996e+07 ... 1.996e+07 2.004e+07
119
126
spatial_ref int64 ... 0
127
+ >>> # CRS is set only if rioxarray is available
128
+ >>> import importlib
129
+ >>> if importlib.util.find_spec("rioxarray"):
130
+ ... raster.rio.crs
131
+ CRS.from_epsg(3857)
120
132
"""
121
133
if not _HAS_CONTEXTILY :
122
134
raise ImportError (
You can’t perform that action at this time.
0 commit comments