diff --git a/docs/getting_started/switching_from_rasterio.rst b/docs/getting_started/switching_from_rasterio.rst index 237ae805..ad59e772 100644 --- a/docs/getting_started/switching_from_rasterio.rst +++ b/docs/getting_started/switching_from_rasterio.rst @@ -31,75 +31,75 @@ Profile Here is the parameters that you can derive from ``rasterio``'s Dataset profile: -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| ``rasterio`` from ``ds.profile`` | ``rioxarray`` from DataArray | -+==================================+=======================================================================================================================+ -| :attr:`blockxsize` | :attr:`.encoding["preferred_chunks"]["x"]` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`blockysize` | :attr:`.encoding["preferred_chunks"]["y"]` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`compress` | *Unused in rioxarray* | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.count` | :attr:`rio.count ` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.crs` | :attr:`rio.crs ` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.driver` | Unused in rioxarray | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.dtype` | :attr:`.encoding["rasterio_dtype"]` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.height` | :attr:`rio.height ` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`interleave` | Unused in rioxarray | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.nodata` | :attr:`rio.nodata ` (or `encoded_nodata `_ ) | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`tiled` | Unused in rioxarray | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:~rasterio.io.DatasetReader.transform` | :func:`rio.transform() ` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.width` | :attr:`rio.width ` | -+----------------------------------+-----------------------------------------------------------------------------------------------------------------------+ ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| ``rasterio`` from ``ds.profile`` | ``rioxarray`` from DataArray | ++==============================================+=======================================================================================================================+ +| :attr:`blockxsize` | :attr:`.encoding["preferred_chunks"]["x"]` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`blockysize` | :attr:`.encoding["preferred_chunks"]["y"]` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`compress` | *Unused in rioxarray* | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.count` | :attr:`rio.count ` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.crs` | :attr:`rio.crs ` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.driver` | Unused in rioxarray | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.dtype` | :attr:`.encoding["rasterio_dtype"]` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.height` | :attr:`rio.height ` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`interleave` | Unused in rioxarray | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.nodata` | :attr:`rio.nodata ` (or `encoded_nodata `_ ) | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`tiled` | Unused in rioxarray | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.transform` | :func:`rio.transform() ` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.width` | :attr:`rio.width ` | ++----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ The values not used in ``rioxarray`` comes from the abstraction of the dataset in ``xarray``: a dataset no longer belongs to a file on disk even if read from it. The driver and other file-related notions are meaningless in this context. Other dataset parameters ------------------------ -+----------------------------------+-------------------------------------------------------------------+ -| ``rasterio`` from ``ds`` | ``rioxarray`` from DataArray | -+==================================+===================================================================+ -| :attr:`~rasterio.io.DatasetReader.gcps` or :func:`~rasterio.io.DatasetReader.get_gcps` | :func:`rio.get_gcps() ` | -+----------------------------------+-------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.rpcs` | :func:`rio.get_rpcs() ` | -+----------------------------------+-------------------------------------------------------------------+ -| :attr:`~rasterio.io.DatasetReader.bounds` | :func:`rio.bounds() ` | -+----------------------------------+-------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------+-------------------------------------------------------------------+ +| ``rasterio`` from ``ds`` | ``rioxarray`` from DataArray | ++========================================================================================+===================================================================+ +| :attr:`~rasterio.io.DatasetReader.gcps` or :func:`~rasterio.io.DatasetReader.get_gcps` | :func:`rio.get_gcps() ` | ++----------------------------------------------------------------------------------------+-------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.rpcs` | :func:`rio.get_rpcs() ` | ++----------------------------------------------------------------------------------------+-------------------------------------------------------------------+ +| :attr:`~rasterio.io.DatasetReader.bounds` | :func:`rio.bounds() ` | ++----------------------------------------------------------------------------------------+-------------------------------------------------------------------+ Functions --------- -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| ``rasterio`` | ``rioxarray`` | -+====================================+===================================================================================================================================+ -| :func:`rasterio.open` | :func:`rioxarray.open_rasterio` or :attr:`xarray.open_dataset(..., engine="rasterio", decode_coords="all") ` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`~rasterio.io.DatasetReader.read` | :func:`compute() ` (load data into memory) | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`ds.read(... window=) ` | :func:`rio.isel_window() ` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`~rasterio.io.DatasetWriter.write` | :func:`rio.to_raster() ` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`mask(..., crop=False) ` | :func:`rio.clip(..., drop=False) ` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`mask(..., crop=True) ` | :func:`rio clip(..., drop=True) ` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`~rasterio.warp.reproject` | :func:`rio.reproject() ` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`~rasterio.merge.merge` | :func:`rioxarray.merge.merge_arrays` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ -| :func:`~rasterio.fill.fillnodata` | :func:`rio.interpolate_na() ` | -+------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| ``rasterio`` | ``rioxarray`` | ++===============================================================+===================================================================================================================================+ +| :func:`rasterio.open` | :func:`rioxarray.open_rasterio` or :attr:`xarray.open_dataset(..., engine="rasterio", decode_coords="all") ` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`~rasterio.io.DatasetReader.read` | :func:`compute() ` (load data into memory) | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`ds.read(... window=) ` | :func:`rio.isel_window() ` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`~rasterio.io.DatasetWriter.write` | :func:`rio.to_raster() ` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`mask(..., crop=False) ` | :func:`rio.clip(..., drop=False) ` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`mask(..., crop=True) ` | :func:`rio clip(..., drop=True) ` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`~rasterio.warp.reproject` | :func:`rio.reproject() ` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`~rasterio.merge.merge` | :func:`rioxarray.merge.merge_arrays` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :func:`~rasterio.fill.fillnodata` | :func:`rio.interpolate_na() ` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+