We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a32169 commit acf48c3Copy full SHA for acf48c3
pygmt/datasets/tile_map.py
@@ -16,6 +16,13 @@
16
TileProvider = None
17
_HAS_CONTEXTILY = False
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
26
import numpy as np
27
import xarray as xr
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(
0 commit comments