Skip to content

Commit 745658b

Browse files
authored
RasterioDeprecationWarning (#3964)
* RasterioDeprecationWarning When a `vrt` is opened, a deprecation warning will be shown: ```python /home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:241: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata riods = WarpedVRT(riods, **vrt_params) /home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:35: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata riods = WarpedVRT(riods, **vrt_params) /home/taher/.local/apps/miniconda/envs/hydrodata/lib/python3.8/site-packages/xarray/backends/rasterio_.py:122: RasterioDeprecationWarning: dst_nodata will be removed in 1.1, use nodata riods = WarpedVRT(riods, **self.vrt_params) ``` This change can be confirmed in `rasterio`'s documentation where `dst_nodata` is replaced with nodata. https://rasterio.readthedocs.io/en/latest/api/rasterio.vrt.html * added changes in #3964 * Update whats-new.rst
1 parent c4e8882 commit 745658b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

doc/whats-new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Bug fixes
7373
- Fix bug where plotting line plots with 2D coordinates depended on dimension
7474
order. (:issue:`3933`)
7575
By `Tom Nicholas <https://github.com/TomNicholas>`_.
76+
- Fix ``RasterioDeprecationWarning`` when using a ``vrt`` in ``open_rasterio``. (:issue:`3964`)
77+
By `Taher Chegini <https://github.com/cheginit>`_.
7678

7779
Documentation
7880
~~~~~~~~~~~~~

xarray/backends/rasterio_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def open_rasterio(filename, parse_coordinates=None, chunks=None, cache=None, loc
224224
crs=vrt.crs.to_string(),
225225
resampling=vrt.resampling,
226226
src_nodata=vrt.src_nodata,
227-
dst_nodata=vrt.dst_nodata,
227+
nodata=vrt.nodata,
228228
tolerance=vrt.tolerance,
229229
transform=vrt.transform,
230230
width=vrt.width,

0 commit comments

Comments
 (0)