Skip to content

Commit

Permalink
Fix datetime parsing in polygonize command
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Nov 5, 2024
1 parent b767db7 commit 7b90cad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ftw_cli/polygonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def polygonize(input, out, simplify, min_size, overwrite, close_interiors):
if format == "Parquet":
timestamp = tags.get("TIFFTAG_DATETIME", None)
if timestamp is not None:
pattern = re.compile(r"^(\d{4})[:-](\d{2})[:-](\d{2})[T\s](\d{2}):(\d{2}):(\d{2}).+$")
pattern = re.compile(r"^(\d{4})[:-](\d{2})[:-](\d{2})[T\s](\d{2}):(\d{2}):(\d{2}).*$")
if pattern.match(timestamp):
timestamp = re.sub(pattern, r"\1-\2-\3T\4:\5:\6Z", timestamp)
else:
Expand Down

0 comments on commit 7b90cad

Please sign in to comment.