Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stac mosaicjson issue #935

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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