Skip to content

Commit

Permalink
fixup! Issue #28: make sure band_indices are ints before passing to p…
Browse files Browse the repository at this point in the history
…yramid builders
  • Loading branch information
soxofaan committed Nov 14, 2019
1 parent 2d93193 commit 4018d27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openeogeotrellis/layercatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def load_collection(self, collection_id: str, viewing_parameters: dict) -> Image
metadata = CollectionMetadata(self.get_collection_metadata(collection_id, strip_private=False))
layer_source_info = metadata.get("_vito", "data_source", default={})
layer_source_type = layer_source_info.get("type", "Accumulo").lower()
logger.info("Layer source type: {s!r}".format(s=layer_source_type))

import geopyspark as gps
from_date = normalize_date(viewing_parameters.get("from", None))
Expand All @@ -56,8 +57,9 @@ def load_collection(self, collection_id: str, viewing_parameters: dict) -> Image
top = viewing_parameters.get("top", None)
bottom = viewing_parameters.get("bottom", None)
srs = viewing_parameters.get("srs", None)
bands = viewing_parameters.get("bands", [])
band_indices = [metadata.get_band_index(b) for b in bands]
bands = viewing_parameters.get("bands", None)
band_indices = [metadata.get_band_index(b) for b in bands] if bands else None
logger.info("band_indices: {b!r}".format(b=band_indices))
# TODO: avoid this `still_needs_band_filter` ugliness.
# Also see https://github.com/Open-EO/openeo-geopyspark-driver/issues/29
still_needs_band_filter = False
Expand Down

0 comments on commit 4018d27

Please sign in to comment.