You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raster/vector/label sources have an extent property that can either refer to the full extent of the data in the source file or a user-specified subset of it. Currently, the latter case is not being handled correctly everywhere.
The text was updated successfully, but these errors were encountered:
@lewfish, which of the following do you think looks more intuitive? Currently, RV is doing a mix of both which is buggy.
Option 1
Pixel indices correspond to the pixel indices in the source file. So, e.g., the first chip_sz=5 window will have a different address depending on the crop. This is simpler and closer to how RV used to handle this in earlier versions.
rs=RasterioSource(..., extent=Box(10, 10, 20, 20))
rs.extent# Box(10, 10, 20, 20)rs.get_chip(Box(0, 0, 5, 5)) # outside the extent so blank chiprs.get_chip(Box(10, 10, 15, 15)) # correct window to get the first chip (chip_sz=5)rs[:5, :5] # equivalent to rs.get_chip(Box(0, 0, 5, 5)), blank chiprs[10:15, 10:15] # equivalent to rs.get_chip(Box(10, 10, 15, 15)), first legit chip
Option 2
Here, pixel indices are relative to the crop. So the first chip_sz=5 window will always be Box(0, 0, 5, 5) regardless of the crop, which is arguably more user-friendly.
rs=RasterioSource(..., bbox=Box(10, 10, 20, 20))
rs.extent# Box(0, 0, 10, 10), always == (0, 0, H, W)rs.bbox# Box(10, 10, 20, 20)rs.get_chip(Box(0, 0, 5, 5)) # correct window to get the first chip (chip_sz=5)rs.get_chip(Box(10, 10, 15, 15)) # outside the extent so blank chiprs[:5, :5] # equivalent to rs.get_chip(Box(0, 0, 5, 5)), first legit chiprs[10:15, 10:15] # equivalent to rs.get_chip(Box(10, 10, 15, 15)), blank chip
Raster/vector/label sources have an extent property that can either refer to the full extent of the data in the source file or a user-specified subset of it. Currently, the latter case is not being handled correctly everywhere.
The text was updated successfully, but these errors were encountered: