Exemple #1
0
        public async Task <CompactionExportResult> GetExportReportVeta(
            [FromQuery] Guid projectUid,
            [FromQuery] string fileName,
            [FromQuery] string machineNames,
            [FromQuery] Guid?filterUid,
            [FromQuery] CoordType coordType = CoordType.Northeast)
        {
            Log.LogInformation($"{nameof(GetExportReportVeta)}: {Request.QueryString}");

            var projectTask     = ((RaptorPrincipal)User).GetProject(projectUid);
            var projectSettings = GetProjectSettingsTargets(projectUid);
            var filterTask      = GetCompactionFilter(projectUid, filterUid);
            var userPreferences = GetUserPreferences();

            await Task.WhenAll(projectTask, projectSettings, filterTask, userPreferences);

            var project = projectTask.Result;
            var filter  = filterTask.Result;

            var startEndDate = await GetDateRange(project.ShortRaptorProjectId, filter);

            var exportRequest = requestFactory.Create <ExportRequestHelper>(r => r
                                                                            .ProjectUid(projectUid)
                                                                            .ProjectId(project.ShortRaptorProjectId)
                                                                            .Headers(CustomHeaders)
                                                                            .ProjectSettings(projectSettings.Result)
                                                                            .Filter(filter))
#if RAPTOR
                                .SetRaptorClient(RaptorClient)
#endif
                                .SetUserPreferences(userPreferences.Result)
                                .SetProjectDescriptor(project)
                                .CreateExportRequest(
                startEndDate.startUtc,
                startEndDate.endUtc,
                coordType,
                ExportTypes.VedaExport,
                fileName,
                false,
                true,
                OutputTypes.VedaAllPasses,
                machineNames);

            exportRequest.Validate();

            var result = await WithServiceExceptionTryExecuteAsync(() => RequestExecutorContainerFactory
                                                                   .Build <CompactionExportExecutor>(LoggerFactory,
#if RAPTOR
                                                                                                     RaptorClient,
#endif
                                                                                                     configStore : ConfigStore,
                                                                                                     trexCompactionDataProxy : TRexCompactionDataProxy,
                                                                                                     customHeaders : CustomHeaders,
                                                                                                     userId : GetUserId(),
                                                                                                     fileImportProxy : FileImportProxy)
                                                                   .ProcessAsync(exportRequest)) as CompactionExportResult;

            Log.LogInformation($"GetExportReportVeta completed");
            return(result);
        }
Exemple #2
0
        public async Task <AlignmentStationRangeResult> GetAlignmentStationRange(
            [FromQuery] Guid projectUid,
            [FromQuery] Guid alignmentFileUid,
            [FromServices] IBoundingBoxService boundingBoxService)
        {
            Log.LogInformation("GetAlignmentStationRange: " + Request.QueryString);

            var projectId           = GetLegacyProjectId(projectUid);
            var alignmentDescriptor = GetAndValidateDesignDescriptor(projectUid, alignmentFileUid);

            await Task.WhenAll(projectId, alignmentDescriptor);

            var request = requestFactory.Create <AlignmentStationRangeRequestHelper>(r => r
                                                                                     .ProjectId(projectId.Result)
                                                                                     .Headers(CustomHeaders))
                          .CreateAlignmentStationRangeRequest(alignmentDescriptor.Result);

            request.Validate();

            var result = await WithServiceExceptionTryExecuteAsync(() =>
                                                                   boundingBoxService.GetAlignmentStationRange(
                                                                       new ProjectData {
                ProjectUID = projectUid.ToString()
            },
                                                                       alignmentDescriptor.Result,
                                                                       CustomHeaders));

            return(result);
        }
Exemple #3
0
        public async Task <CompactionProfileResult <CompactionProfileDataResult> > GetProfileProductionDataSlicer(
            [FromServices] ICompactionProfileResultHelper profileResultHelper,
            [FromQuery] Guid projectUid,
            [FromQuery] double startLatDegrees,
            [FromQuery] double startLonDegrees,
            [FromQuery] double endLatDegrees,
            [FromQuery] double endLonDegrees,
            [FromQuery] Guid?filterUid,
            [FromQuery] Guid?cutfillDesignUid,
            [FromQuery] Guid?volumeBaseUid,
            [FromQuery] Guid?volumeTopUid,
            [FromQuery] VolumeCalcType?volumeCalcType,
            [FromQuery] bool explicitFilters = false)
        {
            Log.LogInformation("GetProfileProductionDataSlicer: " + Request.QueryString);
            var projectId = GetLegacyProjectId(projectUid);

            var settings      = GetProjectSettingsTargets(projectUid);
            var filter        = GetCompactionFilter(projectUid, filterUid);
            var cutFillDesign = GetAndValidateDesignDescriptor(projectUid, cutfillDesignUid, OperationType.Profiling);

            Task <FilterResult>     baseFilter   = null;
            Task <FilterResult>     topFilter    = null;
            Task <DesignDescriptor> volumeDesign = null;

            if (volumeCalcType.HasValue)
            {
                switch (volumeCalcType.Value)
                {
                case VolumeCalcType.GroundToGround:
                    baseFilter = GetCompactionFilter(projectUid, volumeBaseUid);
                    topFilter  = GetCompactionFilter(projectUid, volumeTopUid);

                    await Task.WhenAll(projectId, settings, filter, cutFillDesign, baseFilter, topFilter);

                    break;

                case VolumeCalcType.GroundToDesign:
                    baseFilter   = GetCompactionFilter(projectUid, volumeBaseUid);
                    volumeDesign = GetAndValidateDesignDescriptor(projectUid, volumeTopUid, OperationType.Profiling);

                    await Task.WhenAll(projectId, settings, filter, cutFillDesign, baseFilter, volumeDesign);

                    break;

                case VolumeCalcType.DesignToGround:
                    volumeDesign = GetAndValidateDesignDescriptor(projectUid, volumeBaseUid, OperationType.Profiling);
                    topFilter    = GetCompactionFilter(projectUid, volumeTopUid);

                    await Task.WhenAll(projectId, settings, filter, cutFillDesign, volumeDesign, topFilter);

                    break;
                }
            }

            //Get production data profile
            var slicerProductionDataProfileRequest = requestFactory.Create <ProductionDataProfileRequestHelper>(r => r
                                                                                                                .ProjectId(projectId.Result)
                                                                                                                .ProjectUid(projectUid)
                                                                                                                .Headers(CustomHeaders)
                                                                                                                .ProjectSettings(settings.Result)
                                                                                                                .Filter(filter.Result)
                                                                                                                .DesignDescriptor(cutFillDesign.Result))
                                                     .SetBaseFilter(baseFilter?.Result)
                                                     .SetTopFilter(topFilter?.Result)
                                                     .SetVolumeCalcType(volumeCalcType)
                                                     .SetVolumeDesign(volumeDesign?.Result)
                                                     .CreateProductionDataProfileRequest(startLatDegrees, startLonDegrees, endLatDegrees, endLonDegrees, explicitFilters);

            slicerProductionDataProfileRequest.Validate();

            var slicerProductionDataResult = await WithServiceExceptionTryExecuteAsync(() => RequestExecutorContainerFactory.Build <CompactionProfileExecutor>(LoggerFactory,
#if RAPTOR
                                                                                                                                                               RaptorClient,
#endif
                                                                                                                                                               configStore : ConfigStore, profileResultHelper : profileResultHelper, trexCompactionDataProxy : TRexCompactionDataProxy, customHeaders : CustomHeaders)
                                                                                       .ProcessAsync(slicerProductionDataProfileRequest)) as CompactionProfileResult <CompactionProfileDataResult>;

            if (cutFillDesign.Result != null)
            {
                await FindCutFillElevations(projectId.Result, projectUid, settings.Result, startLatDegrees, startLonDegrees, endLatDegrees, endLonDegrees,
                                            cutFillDesign.Result, profileResultHelper, slicerProductionDataResult, CompactionDataPoint.CUT_FILL, VolumeCalcType.None);
            }

            if (volumeDesign?.Result != null && (volumeCalcType == VolumeCalcType.DesignToGround || volumeCalcType == VolumeCalcType.GroundToDesign))
            {
                await FindCutFillElevations(projectId.Result, projectUid, settings.Result, startLatDegrees, startLonDegrees, endLatDegrees, endLonDegrees,
                                            volumeDesign.Result, profileResultHelper, slicerProductionDataResult, CompactionDataPoint.SUMMARY_VOLUMES, volumeCalcType.Value);
            }
            return(slicerProductionDataResult);
        }
Exemple #4
0
        /// <summary>
        /// Gets the requested tile from Raptor
        /// </summary>
        /// <param name="projectSettings">Project settings to use for Raptor</param>
        /// <param name="projectSettingsColors"></param>
        /// <param name="filter">Filter to use for Raptor</param>
        /// <param name="projectId">Legacy project ID</param>
        /// <param name="projectUid">Unique project identifier</param>
        /// <param name="mode">Display mode; type of data requested</param>
        /// <param name="width">Width of the tile</param>
        /// <param name="height">Height of the tile in pixels</param>
        /// <param name="bbox">Bounding box in radians</param>
        /// <param name="cutFillDesign">Design descriptor for cut-fill</param>
        /// <param name="baseFilter">Base filter for  summary volumes</param>
        /// <param name="topFilter">Top filter for  summary volumes</param>
        /// <param name="volumeDesign">Design descriptor for summary volumes design</param>
        /// <param name="volumeCalcType">Type of summary volumes calculation</param>
        /// <param name="customHeaders">Custom request headers</param>
        /// <returns>Tile result</returns>
        public async Task <TileResult> GetProductionDataTile(CompactionProjectSettings projectSettings, CompactionProjectSettingsColors projectSettingsColors, FilterResult filter, long projectId, Guid projectUid, DisplayMode mode, ushort width, ushort height, BoundingBox2DLatLon bbox, DesignDescriptor cutFillDesign, FilterResult baseFilter, FilterResult topFilter, DesignDescriptor volumeDesign, VolumeCalcType?volumeCalcType, IHeaderDictionary customHeaders, string userId, bool explicitFilters = false)
        {
            var getTile = true;
            ElevationStatisticsResult elevationExtents = null;
            TileRequest tileRequest = null;

            try
            {
                elevationExtents = await GetElevationExtents(projectSettings, filter, projectId, projectUid, mode, customHeaders, userId);
            }
            catch (ServiceException se)
            {
                getTile = mode != DisplayMode.Height;
                if (log.IsTraceEnabled())
                {
                    log.LogTrace(
                        $"Failed to get elevation extents for height request with error: {se.GetResult.Code}:{se.GetResult.Message} a transparent tile will be generated");
                }
            }

            if (getTile)
            {
                tileRequest = requestFactory.Create <TileRequestHelper>(r => r
                                                                        .ProjectUid(projectUid)
                                                                        .ProjectId(projectId)
                                                                        .Headers(customHeaders)
                                                                        .ProjectSettings(projectSettings)
                                                                        .ProjectSettingsColors(projectSettingsColors)
                                                                        .Filter(filter)
                                                                        .DesignDescriptor(cutFillDesign))
                              .SetVolumeCalcType(volumeCalcType)
                              .SetVolumeDesign(volumeDesign)
                              .SetBaseFilter(baseFilter)
                              .SetTopFilter(topFilter)
                              .CreateTileRequest(mode, width, height, bbox, elevationExtents, explicitFilters);

                //TileRequest is both v1 and v2 model so cannot change its validation directly.
                //However for v2 we want to return a transparent empty tile for cut-fill if no design specified.
                //So catch the validation exception for this case.
                try
                {
                    tileRequest.Validate();
                }
                catch (ServiceException se)
                {
                    if (tileRequest.Mode == DisplayMode.CutFill &&
                        se.Code == HttpStatusCode.BadRequest &&
                        se.GetResult.Code == ContractExecutionStatesEnum.ValidationError)
                    {
                        if (
                            se is MissingDesignDescriptorException ||
                            se is TwoFiltersRequiredException ||
                            se is SingleFilterRequiredException)
                        {
                            getTile = false;
                        }
                    }
                    //Rethrow any other exception
                    if (getTile)
                    {
                        throw;
                    }
                }
            }

            TileResult tileResult = null;

            if (getTile)
            {
                try
                {
                    tileResult = await RequestExecutorContainerFactory
                                 .Build <CompactionTileExecutor>(logger,
#if RAPTOR
                                                                 raptorClient,
#endif
                                                                 configStore : ConfigStore, trexCompactionDataProxy : TRexCompactionDataProxy, customHeaders : customHeaders,
                                                                 userId : userId, fileImportProxy : FileImportProxy)
                                 .ProcessAsync(tileRequest) as TileResult;
                }
                catch (Exception ex)
                {
                    log.LogWarning($"Exception: {ex.Message} {ex.StackTrace}");
                }
            }

            return(tileResult?.TileData != null
        ? tileResult
        : TileResult.EmptyTile(WebMercatorProjection.TILE_SIZE, WebMercatorProjection.TILE_SIZE));
        }
Exemple #5
0
        public async Task <FileResult> GetMapTileDataTtm(
            [FromQuery] Guid projectUid,
            [FromQuery] Guid?filterUid,
            [FromQuery] Guid?designUid,
            [FromQuery] DisplayMode mode,
            [FromServices] IPreferenceProxy prefProxy,
            [FromServices] ITRexCompactionDataProxy tRexCompactionDataProxy,
#if RAPTOR
            [FromServices] IASNodeClient raptorClient,
#endif
            [FromServices] IProductionDataRequestFactory requestFactory)
        {
            const double SURFACE_EXPORT_TOLERANCE = 0.05;
            const byte   COORDS_ARRAY_LENGTH      = 3;

            var tins = new List <TrimbleTINModel>();

            var projectTask     = ((RaptorPrincipal)User).GetProject(projectUid);
            var projectSettings = GetProjectSettingsTargets(projectUid);
            var userPreferences = prefProxy.GetUserPreferences(GetUserId(), CustomHeaders);
            var filter          = GetCompactionFilter(projectUid, filterUid);
            var designTask      = GetAndValidateDesignDescriptor(projectUid, designUid);

            if (userPreferences == null)
            {
                throw new ServiceException(HttpStatusCode.BadRequest,
                                           new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults,
                                                                       "Failed to retrieve preferences for current user"));
            }

            await Task.WhenAll(projectTask, projectSettings, userPreferences, designTask);

            var project = projectTask.Result;
            var design  = designTask.Result;

            // Get the terrain mesh
            var exportRequest = requestFactory.Create <ExportRequestHelper>(r => r
                                                                            .ProjectUid(projectUid)
                                                                            .ProjectId(project.ShortRaptorProjectId)
                                                                            .Headers(CustomHeaders)
                                                                            .ProjectSettings(projectSettings.Result)
                                                                            .Filter(filter.Result))
                                .SetUserPreferences(userPreferences.Result)
#if RAPTOR
                                .SetRaptorClient(raptorClient)
#endif
                                .SetProjectDescriptor(project)
                                .CreateExportRequest(
                null, //startUtc,
                null, //endUtc,
                CoordType.LatLon,
                ExportTypes.SurfaceExport,
                "test.zip",
                true,
                false,
                OutputTypes.VedaAllPasses,
                string.Empty,
                SURFACE_EXPORT_TOLERANCE);

            exportRequest.Validate();

            // First get the export of production data from Raptor
            // comes in a zip file
            var result = await WithServiceExceptionTryExecuteAsync(() => RequestExecutorContainerFactory.Build <CompactionExportExecutor>(LoggerFactory,
#if RAPTOR
                                                                                                                                          raptorClient,
#endif
                                                                                                                                          configStore : ConfigStore,
                                                                                                                                          trexCompactionDataProxy : tRexCompactionDataProxy,
                                                                                                                                          customHeaders : CustomHeaders,
                                                                                                                                          userId : GetUserId(),
                                                                                                                                          fileImportProxy : FileImportProxy)
                                                                   .ProcessAsync(exportRequest)) as CompactionExportResult;

            if (result != null)
            {
                var zipStream = (await transferProxyFactory.NewProxy(TransferProxyType.Temporary).Download(result.DownloadLink)).FileStream;
                // If we didn't get a valid file, then we failed to read the ttm from raptor
                if (zipStream == null)
                {
                    throw new ServiceException(HttpStatusCode.BadRequest,
                                               new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults,
                                                                           "Failed to retrieve data"));
                }

                using (var archive = new ZipArchive(zipStream))
                {
                    // The zip file will have exactly one file in it
                    if (archive.Entries.Count == 1)
                    {
                        try
                        {
                            var tin = new TrimbleTINModel();
                            using (var stream = archive.Entries[0].Open() as DeflateStream)
                                using (var ms = new MemoryStream())
                                {
                                    // Unzip the file, copy to memory as the TIN file needs the byte array, and stream
                                    stream.CopyTo(ms);
                                    ms.Seek(0, SeekOrigin.Begin);

                                    tin.LoadFromStream(ms, ms.GetBuffer());

                                    tins.Add(tin);
                                }
                        }
                        catch (TTMFileReadException e)
                        {
                            // Not valid, continue
                            Log.LogWarning(e, "Failed to parse ttm in zip file");
                        }
                    }
                }
            }

            // If we didn't get a valid file, then we failed to read the ttm from raptor
            if (tins.Count == 0)
            {
                throw new ServiceException(HttpStatusCode.BadRequest,
                                           new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults,
                                                                       "Failed to retrieve data"));
            }

            // If we have a design request, get the ttm and add it for parsing
            if (design != null)
            {
                //TODO: This used to get the file from TCC. This code to get from s3 needs testing.
                //Leave for now as this end point is not currently supported.
                // Retrieve the stored file from AWS
                var s3FullPath    = $"{projectUid}/{design.File.FileName}";
                var transferProxy = transferProxyFactory.NewProxy(TransferProxyType.Temporary);
                var fileResult    = await transferProxy.Download(s3FullPath);

                if (fileResult?.FileStream != null)
                {
                    using (var ms = new MemoryStream())
                    {
                        fileResult.FileStream.CopyTo(ms);
                        ms.Seek(0, SeekOrigin.Begin);
                        var tin = new TrimbleTINModel();
                        tin.LoadFromStream(ms, ms.GetBuffer());
                        tins.Add(tin);
                    }
                }
            }

            // Calculating the bounding box for the model (including design if supplied)
            var minEasting     = tins.Select(t => t.Header.MinimumEasting).Min();
            var maxEasting     = tins.Select(t => t.Header.MaximumEasting).Max();
            var minNorthing    = tins.Select(t => t.Header.MinimumNorthing).Min();
            var maxNorthing    = tins.Select(t => t.Header.MaximumNorthing).Max();
            var centerEasting  = (maxEasting + minEasting) / 2.0;
            var centerNorthing = (maxNorthing + minNorthing) / 2.0;

            TwoDConversionCoordinate[] convertedCoordinates;

#if RAPTOR
            if (UseTRexGateway("ENABLE_TREX_GATEWAY_TILES"))
            {
#endif
            var conversionCoordinates = new []
            {
                new TwoDConversionCoordinate(minEasting, minNorthing),
                new TwoDConversionCoordinate(maxEasting, maxNorthing),
                new TwoDConversionCoordinate(centerEasting, centerNorthing)
            }
            ;

            var conversionRequest = new CoordinateConversionRequest(projectUid, TwoDCoordinateConversionType.NorthEastToLatLon, conversionCoordinates);
            var conversionResult  = await trexCompactionDataProxy.SendDataPostRequest <CoordinateConversionResult, CoordinateConversionRequest>(conversionRequest, "/coordinateconversion", CustomHeaders);

            if (conversionResult.Code != 0 || conversionResult.ConversionCoordinates.Length != COORDS_ARRAY_LENGTH)
            {
                throw new ServiceException(HttpStatusCode.BadRequest,
                                           new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults,
                                                                       "Failed to retrieve long lat for boundary"));
            }

            convertedCoordinates = conversionResult.ConversionCoordinates;
#if RAPTOR
        }

        else
        {
            var points = new TWGS84FenceContainer
            {
                FencePoints = new[]
                {
                    TWGS84Point.Point(minEasting, minNorthing),
                    TWGS84Point.Point(maxEasting, maxNorthing),
                    TWGS84Point.Point(centerEasting, centerNorthing),
                }
            };

            // Convert the northing easting values to long lat values
            var res = raptorClient.GetGridCoordinates(project.LegacyProjectId, points, TCoordConversionType.ctNEEtoLLH, out var coordPointList);
            if (res != TCoordReturnCode.nercNoError)
            {
                throw new ServiceException(HttpStatusCode.BadRequest,
                                           new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults,
                                                                       "Failed to retrieve long lat for boundary"));
            }

            convertedCoordinates = coordPointList.Points.Coords.Select(c => new TwoDConversionCoordinate(c.X, c.Y)).ToArray();
        }
#endif

            // The values returned from Raptor/TRex are in rads, where we need degrees for the bbox
            var minLat    = convertedCoordinates[0].Y * Coordinates.RADIANS_TO_DEGREES;
            var minLng    = convertedCoordinates[0].X * Coordinates.RADIANS_TO_DEGREES;
            var maxLat    = convertedCoordinates[1].Y * Coordinates.RADIANS_TO_DEGREES;
            var maxLng    = convertedCoordinates[1].X * Coordinates.RADIANS_TO_DEGREES;
            var centerLat = convertedCoordinates[2].Y * Coordinates.RADIANS_TO_DEGREES;
            var centerLng = convertedCoordinates[2].X * Coordinates.RADIANS_TO_DEGREES;
            var bbox      = $"{minLat},{minLng},{maxLat},{maxLng}";

            var outputStream = new MemoryStream();
            using (var zipArchive = new ZipArchive(outputStream, ZipArchiveMode.Create, true))
            {
                var textureZipEntry = zipArchive.CreateEntry("texture.png");
                using (var stream = textureZipEntry.Open())
                {
                    // Write the texture to the zip
                    var textureFileStream = await GetTexture(projectUid, designUid, projectSettings.Result, filter.Result, mode, bbox);

                    textureFileStream.FileStream.CopyTo(stream);
                }

                // Write the model to the zip
                var modelZipEntry = zipArchive.CreateEntry("model.obj");
                using (var stream = modelZipEntry.Open())
                {
                    var modelFileStream = ConvertMultipleToObj(tins, centerEasting, centerNorthing);
                    modelFileStream.FileStream.CopyTo(stream);
                }

                // Add some metadata to help with positioning of the model
                var metaDataEntry = zipArchive.CreateEntry("metadata.json");
                using (var stream = metaDataEntry.Open())
                {
                    var metaData = new
                    {
                        Minimum = new
                        {
                            Lat = minLat,
                            Lng = minLng
                        },
                        Maximum = new
                        {
                            Lat = maxLat,
                            Lng = maxLng
                        },
                        Center = new
                        {
                            Lat = centerLat,
                            Lng = centerLng
                        },
                        HasDesign = design != null
                    };
                    var bytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(metaData));
                    stream.Write(bytes, 0, bytes.Length);
                }
            }

            // Don't forget to seek back, or else the content length will be 0
            outputStream.Seek(0, SeekOrigin.Begin);
            return(new FileStreamResult(outputStream, ContentTypeConstants.ApplicationZip));
        }
Exemple #6
0
        public async Task <CompactionReportResult> GetReportGrid(
            [FromQuery] Guid projectUid,
            [FromQuery] Guid?filterUid,
            [FromQuery] bool reportElevation,
            [FromQuery] bool reportCmv,
            [FromQuery] bool reportMdp,
            [FromQuery] bool reportPassCount,
            [FromQuery] bool reportTemperature,
            [FromQuery] bool reportCutFill,
            [FromQuery] Guid?cutfillDesignUid,
            [FromQuery] double?gridInterval,
            [FromQuery] GridReportOption gridReportOption,
            [FromQuery] double startNorthing,
            [FromQuery] double startEasting,
            [FromQuery] double endNorthing,
            [FromQuery] double endEasting,
            [FromQuery] double azimuth)
        {
            Log.LogInformation($"{nameof(GetReportGrid)}: " + Request.QueryString);

            var projectId       = GetLegacyProjectId(projectUid);
            var filter          = GetCompactionFilter(projectUid, filterUid);
            var cutFillDesign   = GetAndValidateDesignDescriptor(projectUid, cutfillDesignUid, OperationType.Profiling);
            var projectSettings = GetProjectSettingsTargets(projectUid);

            await Task.WhenAll(projectId, filter, cutFillDesign, projectSettings);

            var reportGridRequest = requestFactory.Create <CompactionReportGridRequestHelper>(r => r
                                                                                              .ProjectUid(projectUid)
                                                                                              .ProjectId(projectId.Result)
                                                                                              .Headers(CustomHeaders)
                                                                                              .ProjectSettings(projectSettings.Result)
                                                                                              .Filter(filter.Result))
                                    .CreateCompactionReportGridRequest(
                reportElevation,
                reportCmv,
                reportMdp,
                reportPassCount,
                reportTemperature,
                reportCutFill,
                cutFillDesign.Result,
                gridInterval,
                gridReportOption,
                startNorthing,
                startEasting,
                endNorthing,
                endEasting,
                azimuth
                );

            reportGridRequest.Validate();

            return(await WithServiceExceptionTryExecuteAsync(() => RequestExecutorContainerFactory.Build <CompactionReportGridExecutor>(LoggerFactory,
#if RAPTOR
                                                                                                                                        RaptorClient,
#endif
                                                                                                                                        configStore : ConfigStore,
                                                                                                                                        trexCompactionDataProxy : TRexCompactionDataProxy,
                                                                                                                                        userId : GetUserId(),
                                                                                                                                        fileImportProxy : FileImportProxy)
                                                             .ProcessAsync(reportGridRequest)) as CompactionReportResult);
        }