Skip to content

Commit

Permalink
Resampling docs typo (#1902)
Browse files Browse the repository at this point in the history
* Fix error in resampling example

* Fix typo in resampling doc

* Introduce sphinx autodoc links in resampling.rst
  • Loading branch information
glostis authored and Sean Gillies committed Apr 14, 2020
1 parent 85bb6f7 commit 6f9e6fe
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions docs/topics/resampling.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Resampling
==========

For details on changing coordinate reference systems, see `Reprojection`.
For details on changing coordinate reference systems, see
:doc:`Reprojection <reproject>`.

Up and downsampling
-------------------
Expand Down Expand Up @@ -42,8 +43,8 @@ method.
# scale image transform
transform = dataset.transform * dataset.transform.scale(
(dataset.width / data.shape[-2]),
(dataset.height / data.shape[-1])
(dataset.width / data.shape[-1]),
(dataset.height / data.shape[-2])
)
Downsampling to 1/2 of the resolution can be done with ``upscale_factor = 1/2``.
Expand All @@ -52,16 +53,16 @@ Downsampling to 1/2 of the resolution can be done with ``upscale_factor = 1/2``.
Resampling Methods
------------------

When you change the raster cell grid, you must recalulate the pixel values.
When you change the raster cell grid, you must recalculate the pixel values.
There is no "correct" way to do this as all methods involve some interpolation.

The current resampling methods can be found in the `rasterio.enums`_ source.
The current resampling methods can be found in the
:class:`rasterio.enums.Resampling()` class.

Of note, the default ``Resampling.nearest`` method may not be suitable for
continuous data. In those cases, ``Resampling.bilinear`` and
``Resampling.cubic`` are better suited. Some specialized statistical
resampling method exist, e.g. ``Resampling.average``, which may be useful when
Of note, the default :attr:`~rasterio.enums.Resampling.nearest` method may not
be suitable for continuous data. In those cases,
:attr:`~rasterio.enums.Resampling.bilinear` and
:attr:`~rasterio.enums.Resampling.cubic` are better suited.
Some specialized statistical resampling method exist, e.g.
:attr:`~rasterio.enums.Resampling.average`, which may be useful when
certain numerical properties of the data are to be retained.


.. _rasterio.enums: https://github.com/mapbox/rasterio/blob/master/rasterio/enums.py#L28

0 comments on commit 6f9e6fe

Please sign in to comment.