Skip to content

Commit

Permalink
Fix stac mosaicjson issue (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Oct 25, 2024
1 parent 688bda4 commit bc5dd7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion leafmap/leafmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,10 @@ def add_stac_layer(
nodata = None

band_names = stac_bands(url, collection, item, titiler_endpoint)
indexes = [band_names.index(band) + 1 for band in assets]
if assets is not None:
indexes = [band_names.index(band) + 1 for band in assets]
else:
indexes = None

params = {
"url": url,
Expand Down
9 changes: 6 additions & 3 deletions leafmap/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,13 @@ def stac_min_max(

values = stats.values()

min_values = [v["min"] for v in values]
max_values = [v["max"] for v in values]
try:
min_values = [v["min"] for v in values]
max_values = [v["max"] for v in values]

return min(min_values), max(max_values)
return min(min_values), max(max_values)
except Exception as e:
return None, None


def stac_info(
Expand Down

0 comments on commit bc5dd7e

Please sign in to comment.