From 4018d277224d2cf13437bb304fdb644d1c6133d3 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Thu, 14 Nov 2019 15:40:47 +0100 Subject: [PATCH] fixup! Issue #28: make sure band_indices are ints before passing to pyramid builders --- openeogeotrellis/layercatalog.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openeogeotrellis/layercatalog.py b/openeogeotrellis/layercatalog.py index fe98eba0c..b84641762 100644 --- a/openeogeotrellis/layercatalog.py +++ b/openeogeotrellis/layercatalog.py @@ -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)) @@ -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