diff --git a/operators/src/util/wrap_with_projection_and_resample.rs b/operators/src/util/wrap_with_projection_and_resample.rs index d1663b5ef..c7e314228 100644 --- a/operators/src/util/wrap_with_projection_and_resample.rs +++ b/operators/src/util/wrap_with_projection_and_resample.rs @@ -1,19 +1,18 @@ use crate::engine::{ - CanonicOperatorName, ExecutionContext, InitializedRasterOperator, RasterOperator, - RasterResultDescriptor, ResultDescriptor, SingleRasterOrVectorSource, WorkflowOperatorPath, + ExecutionContext, InitializedRasterOperator, RasterOperator, RasterResultDescriptor, + ResultDescriptor, SingleRasterOrVectorSource, WorkflowOperatorPath, }; use crate::error::{self, Optimization}; use crate::processing::{ DeriveOutRasterSpecsSource, Downsampling, DownsamplingMethod, DownsamplingParams, - DownsamplingResolution, InitializedRasterReprojection, Interpolation, InterpolationMethod, - InterpolationParams, InterpolationResolution, Reprojection, ReprojectionParams, + DownsamplingResolution, Interpolation, InterpolationMethod, InterpolationParams, + InterpolationResolution, Reprojection, ReprojectionParams, }; use crate::util::Result; use crate::util::input::RasterOrVectorOperator; use geoengine_datatypes::primitives::{ Coordinate2D, SpatialResolution, find_next_best_overview_level_resolution, }; -use geoengine_datatypes::raster::TilingSpecification; use geoengine_datatypes::spatial_reference::SpatialReference; use snafu::ResultExt; @@ -44,11 +43,11 @@ impl WrapWithProjectionAndResample { } } - pub fn wrap_with_projection( + pub async fn wrap_with_projection( self, target_sref: SpatialReference, _target_origin_reference: Option, // TODO: add resampling if origin does not match! Could also do that in projection and avoid extra operation? - tiling_spec: TilingSpecification, + exe_ctx: &dyn ExecutionContext, ) -> Result { let result_sref = self .result_descriptor @@ -75,20 +74,16 @@ impl WrapWithProjectionAndResample { sources: SingleRasterOrVectorSource { source: RasterOrVectorOperator::Raster(self.operator), }, - }; + } + .boxed(); - // create the inititalized operator directly, to avoid re-initializing everything - // TODO: update the workflow operator path in all operators of the graph! - let irp = InitializedRasterReprojection::try_new_with_input( - CanonicOperatorName::from(&reprojected_workflow), - WorkflowOperatorPath::initialize_root(), // FIXME: this is not correct since the root is the child operator - reprojection_params, - self.initialized_operator, - tiling_spec, - )?; - let rd = irp.result_descriptor().clone(); + let irp = reprojected_workflow + .clone() + .initialize(WorkflowOperatorPath::initialize_root(), exe_ctx) + .await?; - Self::new(reprojected_workflow.boxed(), irp.boxed(), rd) + let rd = irp.result_descriptor().clone(); + Self::new(reprojected_workflow, irp.boxed(), rd) }; Ok(res) } @@ -258,10 +253,10 @@ impl WrapWithProjectionAndResample { target_origin_reference: Option, target_spatial_resolution: Option, target_sref: SpatialReference, - tiling_spec: TilingSpecification, exe_ctx: &dyn ExecutionContext, ) -> Result { - self.wrap_with_projection(target_sref, target_origin_reference, tiling_spec)? + self.wrap_with_projection(target_sref, target_origin_reference, exe_ctx) + .await? .wrap_with_resample(target_origin_reference, target_spatial_resolution, exe_ctx) .await } diff --git a/services/src/api/handlers/wcs.rs b/services/src/api/handlers/wcs.rs index 1bf1da862..689d273bf 100644 --- a/services/src/api/handlers/wcs.rs +++ b/services/src/api/handlers/wcs.rs @@ -409,7 +409,6 @@ async fn wcs_get_coverage( Some(request_partition.upper_left()), // TODO: set none if not changed? But how to handle mapping to grid? request_resolution, request_spatial_ref, - tiling_spec, &execution_context, ) .await?; diff --git a/services/src/api/handlers/wms.rs b/services/src/api/handlers/wms.rs index e0a00da2e..51d5ebcc8 100644 --- a/services/src/api/handlers/wms.rs +++ b/services/src/api/handlers/wms.rs @@ -367,7 +367,6 @@ async fn wms_get_map( None, // this needs to be `None`` to avoid moving the data origin to a png pixel origin. Since the WMS requests are not consistent with their origins using them distortes the results more then it helps. Some(request_resolution), request_spatial_ref.into(), - tiling_spec, &execution_context, ) .await?;