Skip to content

Commit

Permalink
Fix case were the raster source with smallestCenterDistance is alread…
Browse files Browse the repository at this point in the history
…y filtered away. #280
  • Loading branch information
EmileSonneveld committed May 13, 2024
1 parent 8506532 commit 6ff3ba7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,8 @@ class FileLayerProvider private(openSearch: OpenSearchClient, openSearchCollecti

requiredSpacetimeKeys = applySpaceTimeMask(datacubeParams, requiredSpacetimeKeys,metadata)
if (isUTM) {
//only for utm is just a safeguard to limit to sentine-1/2 for now
//try to resolve overlap before actually reqding the data
//only for utm is just a safeguard to limit to Sentinel-1/2 for now
//try to resolve overlap before actually reading the data
requiredSpacetimeKeys = requiredSpacetimeKeys.groupByKey().flatMap(t => {

def return_original = t._2.map(source => (t._1,source))
Expand Down Expand Up @@ -1049,7 +1049,7 @@ class FileLayerProvider private(openSearch: OpenSearchClient, openSearchCollecti
if (filteredByCRS.nonEmpty) {
filteredByCRS.map(distance_source => (key, distance_source._2))
} else {
filteredByDistance.filter(_._1._1 == smallestCenterDistance).map(distance_source => (key, distance_source._2))
Seq(filteredByDistance.minBy(_._1._1)).map(distance_source => (key, distance_source._2))
}

}
Expand Down

0 comments on commit 6ff3ba7

Please sign in to comment.