Esempio n. 1
0
        public async Task GetBoundingBoxInvalidProductionDataExtents()
        {
            //Production data outside project boundary is invalid
            var prodDataMinLat = projMinLatRadians - 0.2;
            var prodDataMinLng = projMinLngRadians - 0.2;
            var prodDataMaxLat = projMaxLatRadians + 0.2;
            var prodDataMaxLng = projMaxLngRadians + 0.2;

            var raptorClient = new Mock <IASNodeClient>();

            var statistics = new TICDataModelStatistics();

            raptorClient
            .Setup(x => x.GetDataModelStatistics(project.LegacyProjectId, It.IsAny <TSurveyedSurfaceID[]>(), out statistics))
            .Returns(true);

            var pointList = new TCoordPointList
            {
                ReturnCode = TCoordReturnCode.nercNoError,
                Points     = new TCoordContainer
                {
                    Coords = new[]
                    {
                        new TCoordPoint {
                            X = prodDataMinLng, Y = prodDataMinLat
                        },
                        new TCoordPoint {
                            X = prodDataMaxLng, Y = prodDataMaxLat
                        }
                    }
                }
            };

            raptorClient
            .Setup(x => x.GetGridCoordinates(project.LegacyProjectId, It.IsAny <TWGS84FenceContainer>(),
                                             TCoordConversionType.ctNEEtoLLH, out pointList))
            .Returns(TCoordReturnCode.nercNoError);

            var service = new BoundingBoxService(serviceProvider.GetRequiredService <ILoggerFactory>()
#if RAPTOR
                                                 , raptorClient.Object
#endif
                                                 , new Mock <IConfigurationStore>().Object
                                                 , new Mock <ITRexCompactionDataProxy>().Object, new Mock <IFileImportProxy>().Object
                                                 );
            var bbox = await service.GetBoundingBox(project, null, new[] { TileOverlayType.ProductionData }, null, null, null, null, null);

            Assert.AreEqual(projMinLatRadians, bbox.minLat);
            Assert.AreEqual(projMaxLatRadians, bbox.maxLat);
            Assert.AreEqual(projMinLngRadians, bbox.minLng);
            Assert.AreEqual(projMaxLngRadians, bbox.maxLng);
        }
Esempio n. 2
0
 /// <summary>
 /// Gets a list of grid coordinates converted either from NE or Latitude/Longidude.
 /// </summary>
 /// <param name="projectId">The model/project identifier.</param>
 /// <param name="latlongs">The list of NE or Latitude/Longidude coordinates.</param>
 /// <param name="conversionType">Coordinate conversion type:
 ///                               0 - from Latitude/Longitude to North/East,
 ///                               1 - from North/East to Latitude/Longitude.
 /// </param>
 /// <param name="pointList">The list of converted coordinates.</param>
 /// <returns>An error code:
 ///                         0 - No error,
 ///                         1 - Unknown error,
 ///                         2 - No connection to Server,
 ///                         3 - Missing coordinates,
 ///                         4 - Failed to convert coordinates.
 /// </returns>
 ///
 public TCoordReturnCode GetGridCoordinates(long projectId, TWGS84FenceContainer latlongs, TCoordConversionType conversionType, out TCoordPointList pointList)
 {
     return(client.GetGridCoordinates(projectId, latlongs, conversionType, out pointList));
 }