Skip to content

Commit

Permalink
convert self.dataset.bounds to self.index.bounds to incorporate roi l…
Browse files Browse the repository at this point in the history
…imits
  • Loading branch information
sfalkena committed Sep 20, 2024
1 parent 29c3dc8 commit 83f96b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions torchgeo/samplers/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def __iter__(self) -> Iterator[BoundingBox]:

bounds = hit.bounds
if self.dataset.return_as_ts:
mint = self.dataset.bounds.mint
maxt = self.dataset.bounds.maxt
mint = self.index.bounds.mint
maxt = self.index.bounds.maxt
bounds[-2] = mint
bounds[-1] = maxt

Expand Down Expand Up @@ -242,8 +242,8 @@ def __iter__(self) -> Iterator[BoundingBox]:
rows, cols = tile_to_chips(bounds, self.size, self.stride)

if self.dataset.return_as_ts:
mint = self.dataset.bounds.mint
maxt = self.dataset.bounds.maxt
mint = self.index.bounds.mint
maxt = self.index.bounds.maxt
else:
mint = bounds.mint
maxt = bounds.maxt
Expand Down Expand Up @@ -317,8 +317,8 @@ def __iter__(self) -> Iterator[BoundingBox]:
bounding_box = self.hits[idx].bounds

if self.dataset.return_as_ts:
mint = self.dataset.bounds.mint
maxt = self.dataset.bounds.maxt
mint = self.index.bounds.mint
maxt = self.index.bounds.maxt
else:
mint = bounding_box.mint
maxt = bounding_box.maxt
Expand Down

0 comments on commit 83f96b8

Please sign in to comment.