@@ -501,16 +501,19 @@ def extract(self, md: Any) -> RasterGroupMetadata:
501501 item = md
502502 c = self ._config (item .collection_id )
503503
504- # Ignore non-proj data bands when Item has proj extension, unless user
505- # disabled that filter with `ignore_proj=True` option
506- check_proj = has_proj_ext (item ) and not c .ignore_proj
507-
508504 def _keep (kv : tuple [str , pystac .asset .Asset ], check_proj : bool ) -> bool :
509505 name , asset = kv
510506 if name in c .band_cfg :
511507 return True
512508 return is_raster_data (asset , check_proj = check_proj )
513509
510+ # Ignore non-proj data bands when Item has proj extension, unless user
511+ # disabled that filter with `ignore_proj=True` option
512+ check_proj = (
513+ has_proj_ext (item )
514+ and not c .ignore_proj
515+ and not any (has_proj_data (a ) for a in item .assets .values ())
516+ )
514517 data_bands = dicttoolz .itemfilter (lambda kv : _keep (kv , check_proj ), item .assets )
515518
516519 if len (data_bands ) == 0 and check_proj :
@@ -681,8 +684,8 @@ def _bootstrap(self, item: pystac.item.Item) -> None:
681684 has_proj = False
682685
683686 # We assume that grouping of data bands into grids is consistent across
684- # entire collection, so we compute it once and keep it
685- if has_proj :
687+ # the entire collection, so we compute it once and keep it
688+ if has_proj and data_assets and any ( has_proj_data ( a ) for a in data_assets . values ()) :
686689 _ , band2grid = compute_eo3_grids (data_assets )
687690 else :
688691 band2grid = band2grid_from_gsd (data_assets )
0 commit comments