diff --git a/torchgeo/datasets/geo.py b/torchgeo/datasets/geo.py index aede7e6a405..c72259f03f2 100644 --- a/torchgeo/datasets/geo.py +++ b/torchgeo/datasets/geo.py @@ -415,7 +415,7 @@ def __getitem__(self, query: BoundingBox) -> Dict[str, Any]: directory = os.path.dirname(filepath) match = re.match(filename_regex, filename) if match: - if "date" in match.groupdict(): + if "band" in match.groupdict(): start = match.start("band") end = match.end("band") filename = filename[:start] + band + filename[end:]