- Fixed a bug in
rectify_datasetwhere the conversion from block-space indices to global-space indices was incorrect whenoutput_indices_nameswas provided.
- Added
utils.transform_resolutionto convert spatial resolution between coordinate reference systems (CRS).
- Added function
utils.resolution_degrees_to_metersto convert spatial resolution from degrees to meters at a given geographic latitude.
- Change inconsistent license classifier in
pyproject.toml - Removed the dependency on
zarr. As part of this change,xcube_resampling.grid_mapping.cfconv.add_spatial_refhas been removed, as it only loosely fit the scope of the xcube-resampling repository. - Added
xcube_resampling.utils.get_utm_crsto return the UTM CRS for a given longitude and latitude pair. - In
xcube_resampling.reproject_dataset, the dataset is now clipped when the target grid-mapping covers less than 80% of the source grid-mapping, improving performance for reprojected cutouts. - In
xcube_resampling.affine_transform_dataset, resampling is now performed per spatial slice, ensuring that interpolation is applied only along the spatial axes and no longer across non-spatial dimensions (e.g., time). - When
prevent_nan_propagation=True, computation is now fully lazy. Previously, the implementation checked for NaN values in the source array, which triggered loading of the entire dataset into memory. - Enhanced
GridMappingAPI documentation.
- Fixed a bug in
xcube_resampling.rectify_datasetthat occurred when processing
datasets with decreasing x-coordinates. - Boolean (
bool) data arrays now default to nearest-neighbor interpolation.
For spatial aggregation, values are centered, and0is used as the default fill value—matching the behavior of integer arrays to ensure consistent and valid results.
- Fixed an issue when retrieving coordinate names from regular grid mappings.
- Improved documentation for the
frequencyandtolerancearguments ofxcube_resampling.resample_in_time. - Fixed incorrect time coverage metadata in dataset attributes after calling
xcube_resampling.resample_in_time. xcube_resampling.rectify_datasetis now fully lazy and scalable.- Removed methods
test_ij_bbox_from_xy_bboxandtest_ij_bboxes_from_xy_bboxesfromxcube_resampling.gridmapping.GridMapping. These methods were only used byxcube_resampling.rectify_dataset; their updated implementations now live inxcube_resampling.rectify._compute_source_tile_indexing. - Added support for rectifying datasets with decreasing x-coordinate in
xcube_resampling.rectify_dataset.
- Improved performance when creating
GridMappingfrom 2D coordinates. Parameter estimation now uses only corner points instead of the full set of coordinates, significantly reducing runtime for large datasets. - Bug fix in affine transformations.
Fixed a half-pixel shift that occurred in
xcube_resampling.affine_transform_datasetandxcube_resampling.resample_in_spacewhen the source and target grid mappings shared the same CRS and were regular.
- In
xcube_resampling.resample_in_time, the method suffix in the output data variable names is now added only when theagg_methodsorinterp_methodsparameters are provided as mappings, or when multiple resampling methods are applied to the data variable.
- Added support for spatial rectification of datasets in
xcube_resampling.rectify_dataseteven when spatial coordinates are not stored in the dataset’s coordinate variables.
- Added the
output_indices_namesparameter toxcube_resampling.rectify_datasetto allow storing the source pixel indices.
- Enhanced the function
bbox_overlapso that it can handle bounding boxes crossing the antimeridian - Added new class method
GridMapping.regular_from_bbox, which allows creating a regular grid mapping directly from a bounding box, spatial resolution, and CRS. - Added new function
utils.resolution_meters_to_degreeswhich converts spatial resolution from meters to degrees in latitude and longitude at a given geographic latitude.- 1 degree of latitude ≈ 111,320 meters (constant approximation).
- 1 degree of longitude ≈ 111,320 * cos(latitude) meters.
- Bug fix: fixed grid mapping creation for irregular grids with decreasing longitude along axis 1.
- Added
xcube_resampling.resample_in_timewhich allows to resample a dataset along the time axis. It supports up- and down-sampling. - Renamed the parameter
recover_nanstoprevent_nan_propagations, which can be a boolean or a mapping (from variable name or dtype to boolean) that, whenTrue, prevents NaN propagation during upsampling or interpolation.
- Improved
xcube_resampling.utils.clip_dataset_by_bboxto support datasets with 2D coordinates. This function is also used internally byxcube_resampling.rectify.rectify_dataset. - Added
reproject_bbox, a utility to reproject a bounding box from one CRS to another. - Added
bbox_overlap, a utility that computes the fraction of the source bounding box overlapped by the target bounding box.
- Added algorithm for affine transformation. (#4)
- Added algorithm for rectification of non-regular grids. (#4)
- Added algorithm for reprojection to a different coordinate reference system (CRS). (#4)
- Introduced main function
resample_in_space, which dynamically selects the appropriate resampling algorithm based on the input dataset. (#4) - Added initial unit tests to verify core functionality. (#4)
- Introduced a new unified keyword argument
interp_methodthat supports values0,1,"nearest","triangular", and"bilinear". This argument applies consistently across all three resampling algorithms, simplifying usage and improving API consistency. (#8) - Documentation added, which is available at https://xcube-dev.github.io/xcube-resampling/. (#10)