Skip to content

Commit

Permalink
log usage of resolution improvement #1043
Browse files Browse the repository at this point in the history
  • Loading branch information
bossie committed Feb 12, 2025
1 parent f04ba2d commit b609581
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions openeogeotrellis/load_stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,17 @@ def intersects_temporally(interval) -> bool:
band_names = metadata.band_names

if apply_lcfm_improvements or env.get(EVAL_ENV_KEY.LOAD_STAC_APPLY_LCFM_IMPROVEMENTS, False):
logger.info("applying LCFM resolution improvements")

requested_band_epgs = [epsgs for n, epsgs in band_epsgs.items() if n in band_names]
epsgs = {epsg for epsgs in requested_band_epgs for epsg in epsgs}
unique_epsgs = {epsg for epsgs in requested_band_epgs for epsg in epsgs}
requested_band_resolutions = [res for n, res in band_resolution.items() if n in band_names]

if len(epsgs) == 1 and requested_band_resolutions: # exact resolution
target_epsg = epsgs.pop()
if len(unique_epsgs) == 1 and requested_band_resolutions: # exact resolution
target_epsg = unique_epsgs.pop()
cell_width = cell_height = max(requested_band_resolutions)
elif len(epsgs) == 1: # about 10m in given CRS
target_epsg = epsgs.pop()
elif len(unique_epsgs) == 1: # about 10m in given CRS
target_epsg = unique_epsgs.pop()
try:
utm_zone_from_epsg(proj_epsg)
cell_width = cell_height = 10.0
Expand Down

0 comments on commit b609581

Please sign in to comment.