Skip to content

Re-project match with a large raster #757

Answered by snowman2
JimShady asked this question in Q&A
Discussion options

You must be logged in to vote

Re-project match just uses the same CRS, transform, and shape of the other raster:

reprojected_data_array = self.reproject(

Examples referenced in solution:

Solution:

import rasterio
import rasterio.vrt
import rioxarray

with rasterio.open("large.tif") as src, rasterio.open("template_large.tif") as template:
        with rasterio.vrt.WarpedVRT(
            src,
            crs=template.crs,
            transform=template.transform,
            height=template.height,
            width=template.width,
        ) as vrt:
            rds = rioxarray.open_rasterio(vrt

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@JimShady
Comment options

@JimShady
Comment options

@JimShady
Comment options

@snowman2
Comment options

@JimShady
Comment options

Answer selected by JimShady
Comment options

You must be logged in to vote
1 reply
@JimShady
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants