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 3
3
:class:`xarray.DataArray`.
4
4
"""
5
5
6
+ import contextlib
6
7
from typing import Literal
7
8
8
9
from packaging .version import Version
16
17
TileProvider = None
17
18
_HAS_CONTEXTILY = False
18
19
20
+ with contextlib .suppress (ImportError ):
21
+ # rioxarray is needed to register the rio accessor
22
+ import rioxarray # noqa: F401
23
+
19
24
import numpy as np
20
25
import xarray as xr
21
26
@@ -117,6 +122,10 @@ def load_tile_map(
117
122
* y (y) float64 ... -7.081e-10 -7.858e+04 ... -1.996e+07 -2.004e+07
118
123
* x (x) float64 ... -2.004e+07 -1.996e+07 ... 1.996e+07 2.004e+07
119
124
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)
120
129
"""
121
130
if not _HAS_CONTEXTILY :
122
131
raise ImportError (
You can’t perform that action at this time.
0 commit comments