@@ -988,6 +988,25 @@ def test_resample_filter_spatial(dry_run_env, dry_run_tracer):
988
988
}
989
989
990
990
991
+
992
+ def test_resample_cube_spatial (dry_run_env , dry_run_tracer ):
993
+ polygon = {"type" : "Polygon" , "coordinates" : [[(0 , 0 ), (3 , 5 ), (8 , 2 ), (0 , 0 )]]}
994
+ cube = DataCube (PGNode ("load_collection" , id = "S2_FOOBAR" ), connection = None )
995
+ cube = cube .apply (lambda x : x + 1 )
996
+ cube = cube .resample_cube_spatial (target = DataCube (PGNode ("load_collection" , id = "S2_FOOBAR" ), connection = None ),method = "max" )
997
+
998
+ pg = cube .flat_graph ()
999
+ res = evaluate (pg , env = dry_run_env ,do_dry_run = False )
1000
+
1001
+ source_constraints = dry_run_tracer .get_source_constraints (merge = True )
1002
+ assert len (source_constraints ) == 2
1003
+ src , constraints = source_constraints [0 ]
1004
+ assert src == ("load_collection" , ("S2_FOOBAR" , ()))
1005
+
1006
+ assert constraints == { 'process_type' : [ ProcessType .FOCAL_SPACE ]}
1007
+
1008
+
1009
+
991
1010
def test_auto_align (dry_run_env , dry_run_tracer ):
992
1011
polygon = {"type" : "Polygon" , "coordinates" : [[(0.1 , 0.1 ), (3 , 5 ), (8 , 2 ), (0.1 , 0.1 )]]}
993
1012
cube = DataCube (PGNode ("load_collection" , id = "ESA_WORLDCOVER_10M_2020_V1" ), connection = None )
0 commit comments