diff --git a/torchgeo/samplers/single.py b/torchgeo/samplers/single.py index 5b7a5fad40..f8cd72b2fa 100644 --- a/torchgeo/samplers/single.py +++ b/torchgeo/samplers/single.py @@ -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 )