Skip to content

Commit

Permalink
RasterDataset: fix bug when separate_files and no date in regex (#1191)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart authored Mar 29, 2023
1 parent 0a5e1d9 commit 0dd3d06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchgeo/datasets/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,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:]
Expand Down

0 comments on commit 0dd3d06

Please sign in to comment.