Skip to content

Commit 4448828

Browse files
scottyhqdcherian
andauthored
Delete built-in rasterio backend (#7671)
Co-authored-by: Deepak Cherian <[email protected]>
1 parent 0ac5541 commit 4448828

16 files changed

+3
-1181
lines changed

ci/install-upstream-wheels.sh

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ conda uninstall -y --force \
1414
fsspec \
1515
zarr \
1616
cftime \
17-
rasterio \
1817
packaging \
1918
pint \
2019
bottleneck \
@@ -39,7 +38,6 @@ python -m pip install \
3938
git+https://github.com/dask/distributed \
4039
git+https://github.com/zarr-developers/zarr \
4140
git+https://github.com/Unidata/cftime \
42-
git+https://github.com/rasterio/rasterio \
4341
git+https://github.com/pypa/packaging \
4442
git+https://github.com/hgrecco/pint \
4543
git+https://github.com/pydata/bottleneck \

doc/api.rst

-2
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ Dataset methods
595595
load_dataset
596596
open_dataset
597597
open_mfdataset
598-
open_rasterio
599598
open_zarr
600599
save_mfdataset
601600
Dataset.as_numpy
@@ -1054,7 +1053,6 @@ Tutorial
10541053
:toctree: generated/
10551054

10561055
tutorial.open_dataset
1057-
tutorial.open_rasterio
10581056
tutorial.load_dataset
10591057

10601058
Testing

doc/conf.py

-10
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,12 @@
4949

5050
matplotlib.use("Agg")
5151

52-
try:
53-
import rasterio # noqa: F401
54-
except ImportError:
55-
allowed_failures.update(
56-
["gallery/plot_rasterio_rgb.py", "gallery/plot_rasterio.py"]
57-
)
58-
5952
try:
6053
import cartopy # noqa: F401
6154
except ImportError:
6255
allowed_failures.update(
6356
[
6457
"gallery/plot_cartopy_facetgrid.py",
65-
"gallery/plot_rasterio_rgb.py",
66-
"gallery/plot_rasterio.py",
6758
]
6859
)
6960

@@ -331,7 +322,6 @@
331322
"matplotlib": ("https://matplotlib.org/stable/", None),
332323
"dask": ("https://docs.dask.org/en/latest", None),
333324
"cftime": ("https://unidata.github.io/cftime", None),
334-
"rasterio": ("https://rasterio.readthedocs.io/en/latest", None),
335325
"sparse": ("https://sparse.pydata.org/en/latest/", None),
336326
}
337327

doc/gallery/plot_rasterio.py

-49
This file was deleted.

doc/gallery/plot_rasterio_rgb.py

-32
This file was deleted.

doc/getting-started-guide/installing.rst

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ For netCDF and IO
4141
- `PseudoNetCDF <http://github.com/barronh/pseudonetcdf/>`__: recommended
4242
for accessing CAMx, GEOS-Chem (bpch), NOAA ARL files, ICARTT files
4343
(ffi1001) and many other.
44-
- `rasterio <https://github.com/rasterio/rasterio>`__: for reading GeoTiffs and
45-
other gridded raster datasets.
4644
- `iris <https://github.com/scitools/iris>`__: for conversion to and from iris'
4745
Cube objects
4846

doc/user-guide/io.rst

+1-40
Original file line numberDiff line numberDiff line change
@@ -1157,46 +1157,7 @@ search indices or other automated data discovery tools.
11571157
Rasterio
11581158
--------
11591159

1160-
GeoTIFFs and other gridded raster datasets can be opened using `rasterio`_, if
1161-
rasterio is installed. Here is an example of how to use
1162-
:py:func:`open_rasterio` to read one of rasterio's `test files`_:
1163-
1164-
.. deprecated:: 0.20.0
1165-
1166-
Deprecated in favor of rioxarray.
1167-
For information about transitioning, see:
1168-
`rioxarray getting started docs<https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html>``
1169-
1170-
.. ipython::
1171-
:verbatim:
1172-
1173-
In [7]: rio = xr.open_rasterio("RGB.byte.tif")
1174-
1175-
In [8]: rio
1176-
Out[8]:
1177-
<xarray.DataArray (band: 3, y: 718, x: 791)>
1178-
[1703814 values with dtype=uint8]
1179-
Coordinates:
1180-
* band (band) int64 1 2 3
1181-
* y (y) float64 2.827e+06 2.826e+06 2.826e+06 2.826e+06 2.826e+06 ...
1182-
* x (x) float64 1.021e+05 1.024e+05 1.027e+05 1.03e+05 1.033e+05 ...
1183-
Attributes:
1184-
res: (300.0379266750948, 300.041782729805)
1185-
transform: (300.0379266750948, 0.0, 101985.0, 0.0, -300.041782729805, 28...
1186-
is_tiled: 0
1187-
crs: +init=epsg:32618
1188-
1189-
1190-
The ``x`` and ``y`` coordinates are generated out of the file's metadata
1191-
(``bounds``, ``width``, ``height``), and they can be understood as cartesian
1192-
coordinates defined in the file's projection provided by the ``crs`` attribute.
1193-
``crs`` is a PROJ4 string which can be parsed by e.g. `pyproj`_ or rasterio.
1194-
See :ref:`/examples/visualization_gallery.ipynb#Parsing-rasterio-geocoordinates`
1195-
for an example of how to convert these to longitudes and latitudes.
1196-
1197-
1198-
Additionally, you can use `rioxarray`_ for reading in GeoTiff, netCDF or other
1199-
GDAL readable raster data using `rasterio`_ as well as for exporting to a geoTIFF.
1160+
GDAL readable raster data using `rasterio`_ such as GeoTIFFs can be opened using the `rioxarray`_ extension.
12001161
`rioxarray`_ can also handle geospatial related tasks such as re-projecting and clipping.
12011162

12021163
.. ipython::

doc/whats-new.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ New Features
2626

2727
Breaking changes
2828
~~~~~~~~~~~~~~~~
29-
29+
- Remove deprecated rasterio backend in favor of rioxarray (:pull:`7392`).
30+
By `Scott Henderson <https://github.com/scottyhq>`_.
3031

3132
Deprecations
3233
~~~~~~~~~~~~

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ module = [
5757
"PseudoNetCDF.*",
5858
"pydap.*",
5959
"pytest.*",
60-
"rasterio.*",
6160
"scipy.*",
6261
"seaborn.*",
6362
"setuptools",

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ io =
8888
zarr
8989
fsspec
9090
cftime
91-
rasterio
9291
pooch
9392
## Scitools packages & dependencies (e.g: cartopy, cf-units) can be hard to install
9493
# scitools-iris

xarray/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
open_mfdataset,
88
save_mfdataset,
99
)
10-
from xarray.backends.rasterio_ import open_rasterio
1110
from xarray.backends.zarr import open_zarr
1211
from xarray.coding.cftime_offsets import cftime_range, date_range, date_range_like
1312
from xarray.coding.cftimeindex import CFTimeIndex
@@ -85,7 +84,6 @@
8584
"open_dataarray",
8685
"open_dataset",
8786
"open_mfdataset",
88-
"open_rasterio",
8987
"open_zarr",
9088
"polyval",
9189
"register_dataarray_accessor",

0 commit comments

Comments
 (0)