Skip to content

Adressing floating-point issues #16

@benbovy

Description

@benbovy

I'm reading again the pangeo thread about the limitations of NetCDF-style coordinates for large geospatial rasters to see whether RasterIndex in its current implementation would already fix some of the problems outlined in that thread, including floating-point issues.

This comment makes me think that "just" keeping track of the affine parameters within RasterIndex will probably not solve all those floating-point issues.

For example, when extracting a Region Of Interest (ROI) by data slicing, RasterIndex currently computes new affine parameters that are then wrapped in a new RasterIndex instance. However, if the affine parameters are float numbers, this will not ensure that the pixels of the extracted ROI will be perfectly aligned with those of the original dataset (I think?).

In the comment linked above, there are two suggestions for addressing this problem:

  1. Keep track of both the original affine parameters and slice offsets instead of computing new affine parameters
  2. Introduce some alignment tolerance

I think either suggestion could be pretty easily supported by RasterIndex (I don't see any big technical obstacle for implementing them).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions