Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete built-in rasterio backend #7671

Merged
merged 3 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ci/install-upstream-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ conda uninstall -y --force \
fsspec \
zarr \
cftime \
rasterio \
packaging \
pint \
bottleneck \
Expand All @@ -39,7 +38,6 @@ python -m pip install \
git+https://github.com/dask/distributed \
git+https://github.com/zarr-developers/zarr \
git+https://github.com/Unidata/cftime \
git+https://github.com/rasterio/rasterio \
git+https://github.com/pypa/packaging \
git+https://github.com/hgrecco/pint \
git+https://github.com/pydata/bottleneck \
Expand Down
2 changes: 0 additions & 2 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ Dataset methods
load_dataset
open_dataset
open_mfdataset
open_rasterio
open_zarr
save_mfdataset
Dataset.as_numpy
Expand Down Expand Up @@ -1054,7 +1053,6 @@ Tutorial
:toctree: generated/

tutorial.open_dataset
tutorial.open_rasterio
tutorial.load_dataset

Testing
Expand Down
10 changes: 0 additions & 10 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,12 @@

matplotlib.use("Agg")

try:
import rasterio # noqa: F401
except ImportError:
allowed_failures.update(
["gallery/plot_rasterio_rgb.py", "gallery/plot_rasterio.py"]
)

try:
import cartopy # noqa: F401
except ImportError:
allowed_failures.update(
[
"gallery/plot_cartopy_facetgrid.py",
"gallery/plot_rasterio_rgb.py",
"gallery/plot_rasterio.py",
]
)

Expand Down Expand Up @@ -331,7 +322,6 @@
"matplotlib": ("https://matplotlib.org/stable/", None),
"dask": ("https://docs.dask.org/en/latest", None),
"cftime": ("https://unidata.github.io/cftime", None),
"rasterio": ("https://rasterio.readthedocs.io/en/latest", None),
"sparse": ("https://sparse.pydata.org/en/latest/", None),
}

Expand Down
49 changes: 0 additions & 49 deletions doc/gallery/plot_rasterio.py

This file was deleted.

32 changes: 0 additions & 32 deletions doc/gallery/plot_rasterio_rgb.py

This file was deleted.

2 changes: 0 additions & 2 deletions doc/getting-started-guide/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ For netCDF and IO
- `PseudoNetCDF <http://github.com/barronh/pseudonetcdf/>`__: recommended
for accessing CAMx, GEOS-Chem (bpch), NOAA ARL files, ICARTT files
(ffi1001) and many other.
- `rasterio <https://github.com/rasterio/rasterio>`__: for reading GeoTiffs and
other gridded raster datasets.
- `iris <https://github.com/scitools/iris>`__: for conversion to and from iris'
Cube objects
- `cfgrib <https://github.com/ecmwf/cfgrib>`__: for reading GRIB files via the
Expand Down
41 changes: 1 addition & 40 deletions doc/user-guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1157,46 +1157,7 @@ search indices or other automated data discovery tools.
Rasterio
--------

GeoTIFFs and other gridded raster datasets can be opened using `rasterio`_, if
rasterio is installed. Here is an example of how to use
:py:func:`open_rasterio` to read one of rasterio's `test files`_:

.. deprecated:: 0.20.0

Deprecated in favor of rioxarray.
For information about transitioning, see:
`rioxarray getting started docs<https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html>``

.. ipython::
:verbatim:

In [7]: rio = xr.open_rasterio("RGB.byte.tif")

In [8]: rio
Out[8]:
<xarray.DataArray (band: 3, y: 718, x: 791)>
[1703814 values with dtype=uint8]
Coordinates:
* band (band) int64 1 2 3
* y (y) float64 2.827e+06 2.826e+06 2.826e+06 2.826e+06 2.826e+06 ...
* x (x) float64 1.021e+05 1.024e+05 1.027e+05 1.03e+05 1.033e+05 ...
Attributes:
res: (300.0379266750948, 300.041782729805)
transform: (300.0379266750948, 0.0, 101985.0, 0.0, -300.041782729805, 28...
is_tiled: 0
crs: +init=epsg:32618


The ``x`` and ``y`` coordinates are generated out of the file's metadata
(``bounds``, ``width``, ``height``), and they can be understood as cartesian
coordinates defined in the file's projection provided by the ``crs`` attribute.
``crs`` is a PROJ4 string which can be parsed by e.g. `pyproj`_ or rasterio.
See :ref:`/examples/visualization_gallery.ipynb#Parsing-rasterio-geocoordinates`
for an example of how to convert these to longitudes and latitudes.


Additionally, you can use `rioxarray`_ for reading in GeoTiff, netCDF or other
GDAL readable raster data using `rasterio`_ as well as for exporting to a geoTIFF.
GDAL readable raster data using `rasterio`_ such as GeoTIFFs can be opened using the `rioxarray`_ extension.
`rioxarray`_ can also handle geospatial related tasks such as re-projecting and clipping.

.. ipython::
Expand Down
3 changes: 2 additions & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ New Features

Breaking changes
~~~~~~~~~~~~~~~~

- Remove deprecated rasterio backend in favor of rioxarray (:pull:`7392`).
By `Scott Henderson <https://github.com/scottyhq>`_.

Deprecations
~~~~~~~~~~~~
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ module = [
"PseudoNetCDF.*",
"pydap.*",
"pytest.*",
"rasterio.*",
"scipy.*",
"seaborn.*",
"setuptools",
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ io =
zarr
fsspec
cftime
rasterio
cfgrib
pooch
## Scitools packages & dependencies (e.g: cartopy, cf-units) can be hard to install
Expand Down
2 changes: 0 additions & 2 deletions xarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
open_mfdataset,
save_mfdataset,
)
from xarray.backends.rasterio_ import open_rasterio
from xarray.backends.zarr import open_zarr
from xarray.coding.cftime_offsets import cftime_range, date_range, date_range_like
from xarray.coding.cftimeindex import CFTimeIndex
Expand Down Expand Up @@ -85,7 +84,6 @@
"open_dataarray",
"open_dataset",
"open_mfdataset",
"open_rasterio",
"open_zarr",
"polyval",
"register_dataarray_accessor",
Expand Down
Loading