How are calculate_default_transform and aligned_target different?


yon.davies@...
 

Greetings everyone,

I am trying to do reprojection in chunks and have been using rasterio.warp.calculate_default_transform for getting the projected extent and transform of the chunk. However, I noticed rasterio.warp.aligned_target also returns a transform and bounds, but the transform is a bit different from the one returned by calculate_default_transform. The documentation is a little vague – calculate_default_transform: Output dimensions and transform for a reprojection; aligned_target: Aligns target to specified resolution.

Can anyone illuminate this for me? And do you have any insight for which might be better for reprojecting a huge raster in chunks that will eventually be merged later? Thank you.

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