BUG: Use epsilon to determine rotation when calculating bounds#2568
BUG: Use epsilon to determine rotation when calculating bounds#2568groutr wants to merge 7 commits into
Conversation
|
Decided to use |
|
I'm getting a confusing result when using from affine import identity
from rasterio.transform import array_bounds
t = identity.translation(2, 3)
width, height = 10, 10
array_bounds(height, width, t)
# (2, 13.0, 12.0, 3)I would expect the bounds to be EDIT: It looks like the identity transform is south-up. Any north-up transform involves a reflection (ie. e < 0). |
This reverts commit f39622b.
9aedf6d to
52756b5
Compare
| height = self.height | ||
| if b == d == 0: | ||
| return BoundingBox(c, f + e * height, c + a * width, f) | ||
| if self.transform.is_rectilinear: |
There was a problem hiding this comment.
Mind moving this check to array_bounds and just use array_bounds inside this method?
That way the behavior remains consistent with both methods.
|
This PR is older. @groutr is this something you still have time & interest to work on? |
|
I'll take a look. |
|
Let's punt on this for 1.5.1. |
This should address an issue found when investigating #2565.
A tolerance needs to be considered in the comparison affine coefficients to 0.
I'm not entirely sure where the best place to test this would be. My initial though was to add a test to test_read.py.