Skip to content

Commit

Permalink
make key filtering work for spacetimekey
Browse files Browse the repository at this point in the history
  • Loading branch information
jdries committed Jun 12, 2024
1 parent 731ae89 commit 292afa0
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,15 @@ class OpenEOProcesses extends Serializable {
def filterNegativeSpatialKeys[K: SpatialComponent: ClassTag
](data: MultibandTileLayerRDD[K]):MultibandTileLayerRDD[K] = {
val filtered = data.filter( tuple => {
val sKey = tuple._1.getComponent[SpatialKey]
val sKey =
tuple._1 match {
case key: SpatialKey =>
key
case key:SpaceTimeKey =>
key.spatialKey
case key: Any =>
throw new IllegalArgumentException(s"Unsupported key type: $key")
}
if(sKey.col<0 || sKey.row<0){
logger.debug("Preemptively filtering negative spatial key: " + sKey)
false
Expand Down

0 comments on commit 292afa0

Please sign in to comment.