@@ -638,8 +638,6 @@ where
638638 query : RasterQueryRectangle ,
639639 ctx : & ' a dyn QueryContext ,
640640 ) -> Result < BoxStream < ' a , Result < Self :: Output > > > {
641- log:: debug!( "ÖÖÖÖÖÖ Reprojection query: {:?}" , query) ;
642-
643641 let state = self . state ;
644642
645643 // setup the subquery
@@ -682,9 +680,8 @@ mod tests {
682680 use crate :: mock:: MockFeatureCollectionSource ;
683681 use crate :: mock:: { MockRasterSource , MockRasterSourceParams } ;
684682 use crate :: source:: {
685- FileNotFoundHandling , GdalDatasetGeoTransform , GdalDatasetParameters ,
686- GdalLoadingInfoTemporalSlice , GdalMetaDataList , GdalMetaDataRegular , GdalMetaDataStatic ,
687- GdalSourceTimePlaceholder , TimeReference ,
683+ FileNotFoundHandling , GdalDatasetGeoTransform , GdalDatasetParameters , GdalMetaDataRegular ,
684+ GdalMetaDataStatic , GdalSourceTimePlaceholder , TimeReference ,
688685 } ;
689686 use crate :: util:: gdal:: add_ndvi_dataset;
690687 use crate :: {
@@ -1483,6 +1480,7 @@ mod tests {
14831480
14841481 for r in result {
14851482 assert ! ( r. is_empty( ) ) ;
1483+ assert_eq ! ( r. time, time_interval) ;
14861484 }
14871485 }
14881486
@@ -1754,125 +1752,4 @@ mod tests {
17541752 GridBoundingBox2D :: new_min_max( -1405 , 1405 , -1410 , 1409 ) . unwrap( )
17551753 ) ;
17561754 }
1757-
1758- #[ tokio:: test]
1759- async fn it_sets_correct_temporal_validity_for_partially_undefined_source_regions ( ) -> Result < ( ) >
1760- {
1761- let tile_size_in_pixels = [ 600 , 600 ] . into ( ) ; //TODO ??
1762- let data_geo_transform =
1763- GeoTransform :: new ( Coordinate2D :: new ( 399_960.000 , 5700_000.000 ) , 1098. , -1098. ) ;
1764- let data_bounds = GridBoundingBox2D :: new ( [ 0 , 0 ] , [ 99 , 99 ] ) . unwrap ( ) ;
1765- let result_descriptor = RasterResultDescriptor {
1766- data_type : RasterDataType :: U8 ,
1767- spatial_reference : SpatialReference :: new ( SpatialReferenceAuthority :: Epsg , 32632 ) . into ( ) ,
1768- time : None ,
1769- spatial_grid : SpatialGridDescriptor :: source_from_parts ( data_geo_transform, data_bounds) ,
1770- bands : RasterBandDescriptors :: new_single_band ( ) ,
1771- } ;
1772-
1773- dbg ! ( result_descriptor. spatial_grid) ;
1774-
1775- let m = GdalMetaDataList {
1776- result_descriptor : result_descriptor. clone ( ) ,
1777- params : vec ! [ GdalLoadingInfoTemporalSlice {
1778- time: TimeInterval :: new_unchecked(
1779- TimeInstance :: from_str( "2022-02-01T00:00:00.000Z" ) . unwrap( ) ,
1780- TimeInstance :: from_str( "2022-03-01T00:00:00.000Z" ) . unwrap( ) ,
1781- ) ,
1782- params: Some ( GdalDatasetParameters {
1783- file_path: test_data!(
1784- "raster/sentinel2/S2B_32UMB_20220129_0_L2A__B02.tif_downsampled.tif"
1785- )
1786- . into( ) ,
1787- rasterband_channel: 1 ,
1788- geo_transform: GdalDatasetGeoTransform {
1789- origin_coordinate: data_geo_transform. origin_coordinate,
1790- x_pixel_size: data_geo_transform. x_pixel_size( ) ,
1791- y_pixel_size: data_geo_transform. y_pixel_size( ) ,
1792- } ,
1793- width: data_bounds. axis_size_x( ) ,
1794- height: data_bounds. axis_size_y( ) ,
1795- file_not_found_handling: FileNotFoundHandling :: Error ,
1796- no_data_value: Some ( 0. ) ,
1797- properties_mapping: None ,
1798- gdal_open_options: None ,
1799- gdal_config_options: None ,
1800- allow_alphaband_as_mask: true ,
1801- retry: None ,
1802- } ) ,
1803- cache_ttl: CacheTtlSeconds :: default ( ) ,
1804- } ] ,
1805- } ;
1806-
1807- let tiling_spec = TilingSpecification :: new ( tile_size_in_pixels) ;
1808- let mut exe_ctx = MockExecutionContext :: new_with_tiling_spec ( tiling_spec) ;
1809-
1810- let id: DataId = DatasetId :: new ( ) . into ( ) ;
1811- let name = NamedData :: with_system_name ( "s2" ) ;
1812- exe_ctx. add_meta_data ( id. clone ( ) , name. clone ( ) , Box :: new ( m) ) ;
1813-
1814- let gdal_op = GdalSource {
1815- params : GdalSourceParameters :: new ( name) ,
1816- }
1817- . boxed ( ) ;
1818-
1819- let initialized_operator = RasterOperator :: boxed ( Reprojection {
1820- params : ReprojectionParams {
1821- target_spatial_reference : SpatialReference :: epsg_4326 ( ) ,
1822- derive_out_spec : DeriveOutRasterSpecsSource :: DataBounds ,
1823- } ,
1824- sources : SingleRasterOrVectorSource {
1825- source : gdal_op. into ( ) ,
1826- } ,
1827- } )
1828- . initialize ( WorkflowOperatorPath :: initialize_root ( ) , & exe_ctx)
1829- . await ?;
1830-
1831- let qp = initialized_operator
1832- . query_processor ( )
1833- . unwrap ( )
1834- . get_u8 ( )
1835- . unwrap ( ) ;
1836-
1837- let qr = qp. result_descriptor ( ) ;
1838-
1839- dbg ! ( qr. spatial_grid) ;
1840- let query_ctx = exe_ctx. mock_query_context ( TestDefault :: test_default ( ) ) ;
1841-
1842- // query with Germany bbox which is partially outside of 32632 projection
1843- let request_bounds = SpatialPartition2D :: new (
1844- Coordinate2D :: new ( 5.98865807458 , 54.983104153 ) ,
1845- Coordinate2D :: new ( 15.0169958839 , 47.3024876979 ) ,
1846- ) ?;
1847-
1848- let query_tiling_pixel_grid = qr
1849- . spatial_grid_descriptor ( )
1850- . tiling_grid_definition ( tiling_spec)
1851- . tiling_spatial_grid_definition ( )
1852- . spatial_bounds_to_compatible_spatial_grid ( request_bounds) ;
1853-
1854- let query_rect = RasterQueryRectangle :: new_with_grid_bounds (
1855- query_tiling_pixel_grid. grid_bounds ( ) ,
1856- TimeInterval :: new_instant ( TimeInstance :: from_str ( "2022-02-01T00:00:00.000Z" ) . unwrap ( ) )
1857- . unwrap ( ) ,
1858- BandSelection :: first ( ) ,
1859- ) ;
1860-
1861- dbg ! ( & query_rect) ;
1862-
1863- let qs = qp. raster_query ( query_rect, & query_ctx) . await . unwrap ( ) ;
1864-
1865- let tiles = qs
1866- . map ( Result :: unwrap)
1867- . collect :: < Vec < RasterTile2D < u8 > > > ( )
1868- . await ;
1869-
1870- for r in tiles {
1871- dbg ! ( r. time, r. is_empty( ) ) ;
1872- }
1873-
1874- assert ! ( false ) ;
1875-
1876- Ok ( ( ) )
1877- }
18781755}
0 commit comments