diff --git a/xcube/core/resampling/rectify.py b/xcube/core/resampling/rectify.py index 65673cea0..decd5e94a 100644 --- a/xcube/core/resampling/rectify.py +++ b/xcube/core/resampling/rectify.py @@ -138,12 +138,15 @@ def rectify_dataset( if source_ds_subset is None: return None if source_ds_subset is not source_ds: - source_gm = GridMapping.from_coords( - source_ds_subset.transformed_x, - source_ds_subset.transformed_y, - crs=source_gm.crs, - tile_size=source_gm.tile_size, - ) + if "transformed_x" and "transformed_y" in source_ds_subset: + source_gm = GridMapping.from_coords( + source_ds_subset.transformed_x, + source_ds_subset.transformed_y, + crs=source_gm.crs, + tile_size=source_gm.tile_size, + ) + else: + source_gm = GridMapping.from_dataset(source_ds_subset) source_ds = source_ds_subset if tile_size is not None or is_j_axis_up is not None: