Skip to content

Commit

Permalink
Sort chips based on hit_id
Browse files Browse the repository at this point in the history
  • Loading branch information
stypoumic committed Sep 13, 2024
1 parent 40bb16e commit 3d74557
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions torchgeo/samplers/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ def __iter__(self) -> Iterator[BoundingBox]:
Returns:
(minx, maxx, miny, maxy, mint, maxt) coordinates to index a dataset
"""
# sort chips based on hit_id
self.chips = self.chips.sort_values(by=['hit_id'])

for _, chip in self.chips.iterrows():
print("------------------------------------")
print("Chip FID: {}".format(chip["fid"]))
yield BoundingBox(
chip.minx, chip.maxx, chip.miny, chip.maxy, chip.mint, chip.maxt
)
Expand Down

0 comments on commit 3d74557

Please sign in to comment.