Does rasterio load data into memory while reprojecting?


Denis Rykov
 

Hi there!

I have a general question about reprojection. Consider the following example:

with rasterio.open(fname_src) as src:
    with rasterio.open(fname_dst, 'w', **kwargs) as dst:
        for i in range(1, src.count + 1):
            rasterio.warp.reproject(
                source=rasterio.band(src, i),
                destination=rasterio.band(dst, i),
                src_transform=src.transform,
                src_crs=src.crs,
                dst_transform=dest_affine,
                dst_crs=dst_crs,
                resampling=resampling)

As I can see from source code rasterio reads each band as an N-d array.
Does it mean that rasterio loads each band into memory?

My main question: can I use this code for warping rasters of arbitrary size (or I'm limited by memory size)?

Thanks.

Join main@rasterio.groups.io to automatically receive all group messages.