Exemple #1
0
        public void Include_2D()
        {
            var bound = new BoundingWorldExtent3D(0, 0, 0, 0, 0, 0);

            bound.Include(10, 11);
            bound.Should().BeEquivalentTo(new BoundingWorldExtent3D(0, 0, 10, 11, 0, 0));

            bound.Include(-10, -11);
            bound.Should().BeEquivalentTo(new BoundingWorldExtent3D(-10, -11, 10, 11, 0, 0));
        }
Exemple #2
0
        /// <summary>
        /// Combine this aggregator with another aggregator and store the result in this aggregator
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public ElevationStatisticsAggregator AggregateWith(ElevationStatisticsAggregator other)
        {
            CellSize = other.CellSize;

            if (other.MinElevation < MinElevation)
            {
                MinElevation = other.MinElevation;
            }

            if (other.MaxElevation > MaxElevation)
            {
                MaxElevation = other.MaxElevation;
            }

            CellsUsed    += other.CellsUsed;
            CellsScanned += other.CellsScanned;

            BoundingExtents.Include(other.BoundingExtents);

            return(this);
        }
Exemple #3
0
        /// <summary>
        /// Combine this simple volumes response with another simple volumes response and store the result in this response
        /// </summary>
        /// <param name="other"></param>
        public SimpleVolumesResponse AggregateWith(SimpleVolumesResponse other)
        {
            Cut  = AggregateValue(Cut, other.Cut);
            Fill = AggregateValue(Fill, other.Fill);
            TotalCoverageArea = AggregateValue(TotalCoverageArea, other.TotalCoverageArea);
            CutArea           = AggregateValue(CutArea, other.CutArea);
            FillArea          = AggregateValue(FillArea, other.FillArea);

            BoundingExtentGrid.Include(other.BoundingExtentGrid);

            // Note: WGS84 bounding rectangle is not enlarged - it is computed after all aggregations have occurred.

            return(this);
        }
Exemple #4
0
        private BoundingWorldExtent3D DataStoreExtents(DecimationElevationSubGridTree dataStore)
        {
            BoundingWorldExtent3D ComputedGridExtent = BoundingWorldExtent3D.Inverted();

            dataStore.ScanAllSubGrids(subGrid =>
            {
                SubGridUtilities.SubGridDimensionalIterator((x, y) =>
                {
                    float elev = ((GenericLeafSubGrid <float>)subGrid).Items[x, y];
                    if (elev != 0)
                    {
                        ComputedGridExtent.Include((int)(subGrid.OriginX + x), (int)(subGrid.OriginY + y), elev);
                    }
                    else
                    {
                        ((GenericLeafSubGrid <float>)subGrid).Items[x, y] = TRex.Common.Consts.NullHeight;
                    }
                });

                return(true);
            });

            if (ComputedGridExtent.IsValidPlanExtent)
            {
                ComputedGridExtent.Offset(-(int)SubGridTreeConsts.DefaultIndexOriginOffset, -(int)SubGridTreeConsts.DefaultIndexOriginOffset);
            }

            // Convert the grid rectangle to a world rectangle
            BoundingWorldExtent3D ComputedWorldExtent = new BoundingWorldExtent3D
                                                            ((ComputedGridExtent.MinX - 0.01) * dataStore.CellSize,
                                                            (ComputedGridExtent.MinY - 0.01) * dataStore.CellSize,
                                                            (ComputedGridExtent.MaxX + 1 + 0.01) * dataStore.CellSize,
                                                            (ComputedGridExtent.MaxY + 1 + 0.01) * dataStore.CellSize,
                                                            ComputedGridExtent.MinZ, ComputedGridExtent.MaxZ);

            return(ComputedWorldExtent);
        }
Exemple #5
0
        // These SaveToStream/LoadFromStream methods implement GENERIC save/load functionality
        // NOT NFF save/load functionality
        //   Procedure SaveToStream(Stream : TStream); Overload; override;
        //   Procedure LoadFromStream(Stream : TStream); Overload; override;

        public override BoundingWorldExtent3D BoundingBox()
        {
            if (Vertices.Count == 0)
            {
                return(new BoundingWorldExtent3D(Consts.NullDouble, Consts.NullDouble, Consts.NullDouble, Consts.NullDouble));
            }

            if (Vertices.Count == 1)
            {
                return(new BoundingWorldExtent3D(Vertices.First().X, Vertices.First().Y, Vertices.First().X, Vertices.First().Y));
            }

            var Result = new BoundingWorldExtent3D(Math.Min(Vertices[0].X, Vertices[1].X),
                                                   Math.Min(Vertices[0].Y, Vertices[1].Y),
                                                   Math.Max(Vertices[0].X, Vertices[1].X),
                                                   Math.Max(Vertices[0].Y, Vertices[1].Y));

            for (int I = 1; I < Vertices.Count; I++)
            {
                Result.Include(Vertices[I].X, Vertices[I].Y);
            }

            return(Result);
        }
Exemple #6
0
 /// <summary>
 /// Expands a set 3D ordinate limits by the location of this vertex
 /// </summary>
 /// <param name="boundingExtent"></param>
 public void AdjustLimits(BoundingWorldExtent3D boundingExtent)
 {
     boundingExtent.Include(X, Y, Z);
 }
Exemple #7
0
        /// <summary>
        /// Executor that implements requesting and rendering sub grid information to create the rendered tile
        /// </summary>
        public async Task <SKBitmap> ExecuteAsync()
        {
            // WorkingColorPalette  : TICDisplayPaletteBase;

            _log.LogInformation($"Performing Execute for DataModel:{DataModelID}, Mode={Mode}");

            ApplicationServiceRequestStatistics.Instance.NumMapTileRequests.Increment();

            /*
             * if Assigned(ASNodeImplInstance.RequestCancellations) and
             * ASNodeImplInstance.RequestCancellations.IsRequestCancelled(FExternalDescriptor) then
             * begin
             * if ...SvcLocations.Debug_LogDebugRequestCancellationToFile then
             *   SIGLogMessage.PublishNoODS(Self, 'Request cancelled: ' + FExternalDescriptor.ToString, ...Debug);
             *
             * ResultStatus  = ...RequestHasBeenCancelled;
             * InterlockedIncrement64(ASNodeRequestStats.NumMapTileRequestsCancelled);
             * Exit;
             * end;
             *
             * // The governor is intended to restrict the numbers of heavy weight processes
             * // such as pipelines that interact with the PC layer to request sub grids
             * ScheduledWithGovernor  = ASNodeImplInstance.Governor.Schedule(FExternalDescriptor, Self, gqWMS, ResultStatus);
             * if not ScheduledWithGovernor then
             * Exit;
             */

            var RequestDescriptor = Guid.NewGuid();

            if (_log.IsDebugEnabled())
            {
                if (CoordsAreGrid)
                {
                    _log.LogDebug($"RenderPlanViewTiles Execute: Performing render for request={RequestDescriptor} Args: Project={DataModelID}, Mode={Mode}, CutFillDesign=''{CutFillDesign}'' " +
                                  $"Bound[BL/TR:X/Y]=({BLPoint.X} {BLPoint.Y}, {TRPoint.X} {TRPoint.Y}), Width={NPixelsX}, Height={NPixelsY}");
                }
                else
                {
                    _log.LogDebug($"RenderPlanViewTiles Execute: Performing render for request={RequestDescriptor} Args: Project={DataModelID}, Mode={Mode}, CutFillDesign=''{CutFillDesign}'' " +
                                  $"Bound[BL/TR:Lon/Lat]=({BLPoint.X} {BLPoint.Y}, {TRPoint.X} {TRPoint.Y}), Width={NPixelsX}, Height={NPixelsY}");
                }

                // Include the details of the filters with the logged tile parameters
                if (Filters != null)
                {
                    for (var i = 0; i < Filters.Filters.Length; i++)
                    {
                        _log.LogDebug($"Filter({i}): {Filters.Filters[i]}");
                    }
                }
            }

            // Determine the grid (NEE) coordinates of the bottom/left, top/right WGS-84 positions
            // given the project's coordinate system. If there is no coordinate system then exit.

            var SiteModel = DIContext.Obtain <ISiteModels>().GetSiteModel(DataModelID);

            if (SiteModel == null)
            {
                _log.LogWarning($"Failed to locate site model {DataModelID}");
                return(null);
            }

            _log.LogInformation($"Got Site model {DataModelID}, production data extents are {SiteModel.SiteModelExtent}");

            LLHCoords = new[]
            {
                new XYZ(BLPoint.X, BLPoint.Y, 0),
                new XYZ(TRPoint.X, TRPoint.Y, 0),
                new XYZ(BLPoint.X, TRPoint.Y, 0),
                new XYZ(TRPoint.X, BLPoint.Y, 0)
            };
            _log.LogInformation($"LLHCoords for tile request {string.Concat(LLHCoords)}, CoordsAreGrid {CoordsAreGrid}");

            if (CoordsAreGrid)
            {
                NEECoords = LLHCoords;
            }
            else
            {
                NEECoords = DIContext
                            .Obtain <ICoreXWrapper>()
                            .LLHToNEE(SiteModel.CSIB(), LLHCoords.ToCoreX_XYZ(), CoreX.Types.InputAs.Radians)
                            .ToTRex_XYZ();
            }
            _log.LogInformation($"After conversion NEECoords are {string.Concat(NEECoords)}");

            WorldTileHeight = MathUtilities.Hypot(NEECoords[0].X - NEECoords[2].X, NEECoords[0].Y - NEECoords[2].Y);
            WorldTileWidth  = MathUtilities.Hypot(NEECoords[0].X - NEECoords[3].X, NEECoords[0].Y - NEECoords[3].Y);

            var dx = NEECoords[2].X - NEECoords[0].X;
            var dy = NEECoords[2].Y - NEECoords[0].Y;

            // Calculate the tile rotation as the mathematical angle turned from 0 (due east) to the vector defined by dy/dx
            TileRotation = Math.Atan2(dy, dx);

            // Convert TileRotation to represent the angular deviation rather than a bearing
            TileRotation = (Math.PI / 2) - TileRotation;

            RotatedTileBoundingExtents.SetInverted();
            NEECoords.ForEach(xyz => RotatedTileBoundingExtents.Include(xyz.X, xyz.Y));

            _log.LogInformation($"Tile render executing across tile: [Rotation:{TileRotation}, {MathUtilities.RadiansToDegrees(TileRotation)} degrees] " +
                                $" [BL:{NEECoords[0].X}, {NEECoords[0].Y}, TL:{NEECoords[2].X},{NEECoords[2].Y}, " +
                                $"TR:{NEECoords[1].X}, {NEECoords[1].Y}, BR:{NEECoords[3].X}, {NEECoords[3].Y}] " +
                                $"World Width, Height: {WorldTileWidth}, {WorldTileHeight}, Rotated bounding extents: {RotatedTileBoundingExtents}");

            // Construct the renderer, configure it, and set it on its way
            //  WorkingColorPalette = Nil;

            using (var Renderer = new PlanViewTileRenderer())
            {
                try
                {
                    // Intersect the site model extents with the extents requested by the caller
                    var adjustedSiteModelExtents = SiteModel.GetAdjustedDataModelSpatialExtents(null);

                    _log.LogInformation($"Calculating intersection of bounding box and site model {DataModelID}:{adjustedSiteModelExtents}");

                    var dataSelectionExtent = new BoundingWorldExtent3D(RotatedTileBoundingExtents);
                    dataSelectionExtent.Intersect(adjustedSiteModelExtents);
                    if (!dataSelectionExtent.IsValidPlanExtent)
                    {
                        ResultStatus = RequestErrorStatus.InvalidCoordinateRange;
                        _log.LogInformation($"Site model extents {adjustedSiteModelExtents}, do not intersect RotatedTileBoundingExtents {RotatedTileBoundingExtents}");

                        using var mapView = new MapSurface();

                        mapView.SetBounds(NPixelsX, NPixelsY);

                        var canvas = mapView.BitmapCanvas;
                        mapView.BitmapCanvas = null;

                        return(canvas);
                    }

                    // Compute the override cell boundary to be used when processing cells in the sub grids
                    // selected as a part of this pipeline
                    // Increase cell boundary by one cell to allow for cells on the boundary that cross the boundary

                    SubGridTree.CalculateIndexOfCellContainingPosition(dataSelectionExtent.MinX,
                                                                       dataSelectionExtent.MinY, SiteModel.CellSize, SubGridTreeConsts.DefaultIndexOriginOffset,
                                                                       out var CellExtents_MinX, out var CellExtents_MinY);
                    SubGridTree.CalculateIndexOfCellContainingPosition(dataSelectionExtent.MaxX,
                                                                       dataSelectionExtent.MaxY, SiteModel.CellSize, SubGridTreeConsts.DefaultIndexOriginOffset,
                                                                       out var CellExtents_MaxX, out var CellExtents_MaxY);

                    var CellExtents = new BoundingIntegerExtent2D(CellExtents_MinX, CellExtents_MinY, CellExtents_MaxX, CellExtents_MaxY);
                    CellExtents.Expand(1);

                    var filterSet = FilterUtilities.ConstructFilters(Filters, VolumeType);
                    // Construct PipelineProcessor
                    using var processor = DIContext.Obtain <IPipelineProcessorFactory>().NewInstanceNoBuild <SubGridsRequestArgument>(
                              RequestDescriptor,
                              DataModelID,
                              GridDataFromModeConverter.Convert(Mode),
                              new SubGridsPipelinedResponseBase(),
                              filterSet,
                              CutFillDesign,
                              DIContext.Obtain <Func <PipelineProcessorTaskStyle, ITRexTask> >()(PipelineProcessorTaskStyle.PVMRendering),
                              DIContext.Obtain <Func <PipelineProcessorPipelineStyle, ISubGridPipelineBase> >()(PipelineProcessorPipelineStyle.DefaultProgressive),
                              DIContext.Obtain <IRequestAnalyser>(),
                              Utilities.DisplayModeRequireSurveyedSurfaceInformation(Mode) && Utilities.FilterRequireSurveyedSurfaceInformation(Filters),
                              requestRequiresAccessToDesignFileExistenceMap: Utilities.RequestRequiresAccessToDesignFileExistenceMap(Mode, CutFillDesign),
                              CellExtents,
                              LiftParams
                              );
                    if (filterSet.Filters.Length == 3)
                    {
                        var pipeline = processor.Pipeline as SubGridPipelineProgressive <SubGridsRequestArgument, SubGridRequestsResponse>;
                        pipeline.SubGridsRequestComputeStyle = SubGridsRequestComputeStyle.SimpleVolumeThreeWayCoalescing;
                    }

                    // Set the PVM rendering rexTask parameters for progressive processing
                    processor.Task.TRexNodeID = RequestingTRexNodeID;
                    ((IPVMRenderingTask)processor.Task).TileRenderer = Renderer;

                    // Set the spatial extents of the tile boundary rotated into the north reference frame of the cell coordinate system to act as
                    // a final restriction of the spatial extent used to govern data requests
                    processor.OverrideSpatialExtents.Assign(RotatedTileBoundingExtents);

                    // Prepare the processor
                    if (!processor.Build())
                    {
                        _log.LogError($"Failed to build pipeline processor for request to model {SiteModel.ID}");
                        ResultStatus = RequestErrorStatus.FailedToConfigureInternalPipeline;
                        return(null);
                    }

                    // Test to see if the tile can be satisfied with a representational render indicating where
                    // data is but not what it is (this is useful when the zoom level is far enough away that we
                    // cannot meaningfully render the data). If the size of s sub grid is smaller than
                    // the size of a pixel in the requested tile then do this. Just check the X dimension
                    // as the data display is isotropic.
                    // TODO: Could this be done before creation of the pipeline processor?
                    if (Utilities.SubGridShouldBeRenderedAsRepresentationalDueToScale(WorldTileWidth, WorldTileHeight, NPixelsX, NPixelsY, processor.OverallExistenceMap.CellSize))
                    {
                        return(RenderTileAsRepresentationalDueToScale(processor.OverallExistenceMap)); // There is no need to do anything else
                    }

                    /* TODO - Create a scaled palette to use when rendering the data
                     * // Create a scaled palette to use when rendering the data
                     * if not CreateAndInitialiseWorkingColorPalette then
                     *  begin
                     *  SIGLogMessage.PublishNoODS(Self, Format('Failed to create and initialise working color palette for data: %s in datamodel %d', [TypInfo.GetEnumName(TypeInfo(TICDisplayMode), Ord(FMode)), FDataModelID]), ...Warning);
                     *  Exit;
                     *  end;
                     */

                    // Renderer.WorkingPalette = WorkingColorPalette;

                    Renderer.IsWhollyInTermsOfGridProjection = true; // Ensure the renderer knows we are using grid projection coordinates

                    Renderer.SetBounds(RotatedTileBoundingExtents.CenterX - WorldTileWidth / 2,
                                       RotatedTileBoundingExtents.CenterY - WorldTileHeight / 2,
                                       WorldTileWidth, WorldTileHeight,
                                       NPixelsX, NPixelsY);
                    Renderer.TileRotation = TileRotation;

                    var performRenderStopWatch = Stopwatch.StartNew();
                    ResultStatus = Renderer.PerformRender(Mode, processor, ColorPalettes, Filters, LiftParams);
                    _log.LogInformation($"Renderer.PerformRender completed in {performRenderStopWatch.Elapsed}");

                    if (processor.Response.ResultStatus == RequestErrorStatus.OK)
                    {
                        var canvas = Renderer.Displayer.MapView.BitmapCanvas;
                        Renderer.Displayer.MapView.BitmapCanvas = null;
                        return(canvas);
                    }
                }
                catch (Exception e)
                {
                    _log.LogError(e, "Exception occurred");
                    ResultStatus = RequestErrorStatus.Exception;
                }
            }

            return(null);
        }
Exemple #8
0
        /// <summary>
        /// Setup pipeline for tile request
        /// </summary>
        /// <param name="siteModelExtent">Site Model Extent</param>
        /// <param name="cellSize">Cell Size</param>
        /// <returns></returns>
        private async Task <bool> SetupPipelineTask(BoundingWorldExtent3D siteModelExtent, double cellSize)
        {
            var requestDescriptor = Guid.NewGuid();

            if (DisplayMode == QMConstants.DisplayModeStandard)
            {
                // Note coords are always supplied lat long
                if (SiteModel.CSIB() == string.Empty)
                {
                    ResultStatus = RequestErrorStatus.EmptyCoordinateSystem;
                    _log.LogError($"Failed to obtain site model coordinate system CSIB file for Project:{DataModelUid}");
                    return(false);
                }
            }

            LLHCoords = new[] { new XYZ(MapUtils.Deg2Rad(TileBoundaryLL.West), MapUtils.Deg2Rad(TileBoundaryLL.South), 0),
                                new XYZ(MapUtils.Deg2Rad(TileBoundaryLL.East), MapUtils.Deg2Rad(TileBoundaryLL.North), 0),
                                new XYZ(MapUtils.Deg2Rad(TileBoundaryLL.West), MapUtils.Deg2Rad(TileBoundaryLL.North), 0),
                                new XYZ(MapUtils.Deg2Rad(TileBoundaryLL.East), MapUtils.Deg2Rad(TileBoundaryLL.South), 0) };

            // This will change in Part3 once development is complete
            var strCSIB   = DisplayMode == QMConstants.DisplayModeStandard ? SiteModel.CSIB() : DIMENSIONS_2012_DC_CSIB;
            var NEECoords = DIContext.Obtain <ICoreXWrapper>().LLHToNEE(strCSIB, LLHCoords.ToCoreX_XYZ(), CoreX.Types.InputAs.Radians).ToTRex_XYZ();

            GridIntervalX = (NEECoords[1].X - NEECoords[0].X) / (TileGridSize - 1);
            GridIntervalY = (NEECoords[1].Y - NEECoords[0].Y) / (TileGridSize - 1);

            _log.LogDebug($"#Tile#.({TileX},{TileY}) TileInfo: Zoom:{TileZ}, TileSizeXY:{Math.Round(NEECoords[1].X - NEECoords[0].X, 3)}m x {Math.Round(NEECoords[2].Y - NEECoords[0].Y, 3)}m, GridInterval(m) X:{Math.Round(GridIntervalX, 3)}, Y:{Math.Round(GridIntervalY, 3)}, GridSize:{TileGridSize}");

            var WorldTileHeight = MathUtilities.Hypot(NEECoords[0].X - NEECoords[2].X, NEECoords[0].Y - NEECoords[2].Y);
            var WorldTileWidth  = MathUtilities.Hypot(NEECoords[0].X - NEECoords[3].X, NEECoords[0].Y - NEECoords[3].Y);

            double dx = NEECoords[2].X - NEECoords[0].X;

            CenterX = NEECoords[2].X + dx / 2;
            double dy = NEECoords[2].Y - NEECoords[0].Y;

            CenterY = NEECoords[0].Y + dy / 2;

            // Calculate the tile rotation as the mathematical angle turned from 0 (due east) to the vector defined by dy/dx
            TileRotation = Math.Atan2(dy, dx);

            // Convert TileRotation to represent the angular deviation rather than a bearing
            TileRotation = (Math.PI / 2) - TileRotation;

            SetRotation(TileRotation);

            _log.LogDebug($"QMTile render executing across tile: [Rotation:{ MathUtilities.RadiansToDegrees(TileRotation)}] " +
                          $" [BL:{NEECoords[0].X}, {NEECoords[0].Y}, TL:{NEECoords[2].X},{NEECoords[2].Y}, " +
                          $"TR:{NEECoords[1].X}, {NEECoords[1].Y}, BR:{NEECoords[3].X}, {NEECoords[3].Y}] " +
                          $"World Width, Height: {WorldTileWidth}, {WorldTileHeight}");

            RotatedTileBoundingExtents.SetInverted();
            foreach (var xyz in NEECoords)
            {
                RotatedTileBoundingExtents.Include(xyz.X, xyz.Y);
            }


            // Intersect the site model extents with the extents requested by the caller
            _log.LogDebug($"Tile.({TileX},{TileY}) Calculating intersection of bounding box and site model {DataModelUid}:{siteModelExtent}");
            var dataSelectionExtent = new BoundingWorldExtent3D(RotatedTileBoundingExtents);

            dataSelectionExtent.Intersect(siteModelExtent);
            if (!dataSelectionExtent.IsValidPlanExtent)
            {
                ResultStatus = RequestErrorStatus.InvalidCoordinateRange;
                _log.LogInformation($"Tile.({TileX},{TileY}) Site model extents {siteModelExtent}, do not intersect RotatedTileBoundingExtents {RotatedTileBoundingExtents}");
                return(false);
            }

            // Compute the override cell boundary to be used when processing cells in the sub grids
            // selected as a part of this pipeline
            // Increase cell boundary by one cell to allow for cells on the boundary that cross the boundary
            SubGridTree.CalculateIndexOfCellContainingPosition(dataSelectionExtent.MinX,
                                                               dataSelectionExtent.MinY, cellSize, SubGridTreeConsts.DefaultIndexOriginOffset,
                                                               out var CellExtents_MinX, out var CellExtents_MinY);
            SubGridTree.CalculateIndexOfCellContainingPosition(dataSelectionExtent.MaxX,
                                                               dataSelectionExtent.MaxY, cellSize, SubGridTreeConsts.DefaultIndexOriginOffset,
                                                               out var CellExtents_MaxX, out var CellExtents_MaxY);
            var CellExtents = new BoundingIntegerExtent2D(CellExtents_MinX, CellExtents_MinY, CellExtents_MaxX, CellExtents_MaxY);

            CellExtents.Expand(1);

            // Setup Task
            task      = DIContext.Obtain <Func <PipelineProcessorTaskStyle, ITRexTask> >()(PipelineProcessorTaskStyle.QuantizedMesh) as QuantizedMeshTask;
            processor = DIContext.Obtain <IPipelineProcessorFactory>().NewInstanceNoBuild <SubGridsRequestArgument>(requestDescriptor: requestDescriptor,
                                                                                                                    dataModelID: DataModelUid,
                                                                                                                    gridDataType: GridDataType.Height,
                                                                                                                    response: GriddedElevationsResponse,
                                                                                                                    filters: Filters,
                                                                                                                    cutFillDesign: new DesignOffset(),
                                                                                                                    task: task,
                                                                                                                    pipeline: DIContext.Obtain <Func <PipelineProcessorPipelineStyle, ISubGridPipelineBase> >()(PipelineProcessorPipelineStyle.DefaultProgressive),
                                                                                                                    requestAnalyser: DIContext.Obtain <IRequestAnalyser>(),
                                                                                                                    requireSurveyedSurfaceInformation: true, //Rendering.Utilities.DisplayModeRequireSurveyedSurfaceInformation(DisplayMode.Height) && Rendering.Utilities.FilterRequireSurveyedSurfaceInformation(Filters),
                                                                                                                    requestRequiresAccessToDesignFileExistenceMap: false,
                                                                                                                    overrideSpatialCellRestriction: CellExtents,
                                                                                                                    liftParams: LiftParams
                                                                                                                    );

            // Set the grid TRexTask parameters for progressive processing
            processor.Task.RequestDescriptor = requestDescriptor;
            processor.Task.TRexNodeID        = RequestingTRexNodeID;
            processor.Task.GridDataType      = GridDataType.Height;

            // Set the spatial extents of the tile boundary rotated into the north reference frame of the cell coordinate system to act as
            // a final restriction of the spatial extent used to govern data requests
            processor.OverrideSpatialExtents.Assign(RotatedTileBoundingExtents);

            // Setup new grid array for results
            GriddedElevDataArray = new GriddedElevDataRow[TileGridSize, TileGridSize];
            // build up a data sample grid from SW to NE
            for (int y = 0; y < TileGridSize; y++)
            {
                for (int x = 0; x < TileGridSize; x++)
                {
                    var x1 = NEECoords[0].X + (GridIntervalX * x);
                    var y1 = NEECoords[0].Y + (GridIntervalY * y);
                    if (Rotating)
                    {
                        Rotate_point(x1, y1, out x1, out y1);
                    }
                    GriddedElevDataArray[x, y].Easting   = x1;
                    GriddedElevDataArray[x, y].Northing  = y1;
                    GriddedElevDataArray[x, y].Elevation = CellPassConsts.NullHeight;
                }
            }

            _log.LogDebug($"Tile.({TileX},{TileY}) Boundary grid coords:{string.Concat(NEECoords)}");
            _log.LogDebug($"Tile.({TileX},{TileY}) First Easting:{GriddedElevDataArray[0, 0].Easting} Northing:{GriddedElevDataArray[0, 0].Northing}");
            _log.LogDebug($"Tile.({TileX},{TileY}) Last Easting:{GriddedElevDataArray[TileGridSize - 1, TileGridSize - 1].Easting} Northing:{GriddedElevDataArray[TileGridSize - 1, TileGridSize - 1].Northing}");

            // point to container for results
            task.GriddedElevDataArray = GriddedElevDataArray;
            task.GridIntervalX        = GridIntervalX;
            task.GridIntervalY        = GridIntervalY;
            task.GridSize             = TileGridSize;
            // Tile boundary
            task.TileMinX        = NEECoords[0].X;
            task.TileMinY        = NEECoords[0].Y;
            task.TileMaxX        = NEECoords[1].X;
            task.TileMaxY        = NEECoords[1].Y;
            task.LowestElevation = LowestElevation;

            Azimuth       = 0;
            StartNorthing = NEECoords[0].Y;
            StartEasting  = NEECoords[0].X;

            // Commented out for purposes of demo until relationship between TRex mediated skip/step selection and the quantised mesh tile vertex based selection are better understood
            //    processor.Pipeline.AreaControlSet =
            //     new AreaControlSet(false, GridIntervalX, GridIntervalY, StartEasting, StartNorthing, Azimuth);

            if (!processor.Build())
            {
                _log.LogError($"Tile.({TileX},{TileY}) Failed to build pipeline processor for request to model {DataModelUid}");
                return(false);
            }

            return(true);
        }