Skip to content

Commit

Permalink
Improve file name
Browse files Browse the repository at this point in the history
Closes #69

- Zero padding for counter
- v before version number
- Underscores instead of hyphon separators
- Drop hyphons from date stamp
  • Loading branch information
yellowcap committed Dec 7, 2023
1 parent b168a54 commit 35847e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ def tiler(stack, date, mgrs, bucket):
] * (len(tile.band) - 3)

# Write tile to tempdir
name = f"{dir}/claytile-{mgrs}-{date}-{VERSION}-{counter}.tif"
name = "{dir}/claytile_{mgrs}_{date}_v{version}_{counter}.tif".format(
dir=dir,
mgrs=mgrs,
date=date.replace("-", ""),
version=VERSION,
counter=str(counter).zfill(4),
)
tile.rio.to_raster(name, compress="deflate")

with rasterio.open(name, "r+") as rst:
Expand Down

0 comments on commit 35847e8

Please sign in to comment.