Skip to content

Commit

Permalink
fix blocksize/blockxsize mix-up
Browse files Browse the repository at this point in the history
  • Loading branch information
ungarj committed Sep 18, 2023
1 parent 1dec07c commit 0213cf8
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions mapchete/formats/default/gtiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,19 @@ def prepare(self, process_area=None, **kwargs):
crs=self.pyramid.crs,
**creation_options,
)
for blocksize in ["blockxsize", "blockysize"]:
if self._profile.get(blocksize) is not None:
self._profile[blocksize] = int(self._profile[blocksize])
if self.cog:
if self._profile.get("blocksize") is not None:
self._profile["blocksize"] = int(self._profile.get("blocksize"))
else:
for blocksize in ["blockxsize", "blockysize"]:
if self._profile.get(blocksize) is not None:
self._profile[blocksize] = int(self._profile[blocksize])
logger.debug("single GTiff profile: %s", str(self._profile))
logger.debug(
get_maximum_overview_level(
width, height, minsize=self._profile["blockxsize"]
width,
height,
minsize=self._profile.get("blocksize", self._profile.get("blockxsize")),
)
)
if self.cog or "overviews" in self.output_params:
Expand All @@ -466,7 +472,11 @@ def prepare(self, process_area=None, **kwargs):
for i in range(
1,
get_maximum_overview_level(
width, height, minsize=self._profile["blockxsize"]
width,
height,
minsize=self._profile.get(
"blocksize", self._profile.get("blockxsize")
),
),
)
],
Expand Down

0 comments on commit 0213cf8

Please sign in to comment.