Beispiel #1
0
 public void Init(ElevationService elevationService
                  , SharpGltfService gltfService
                  , MeshService meshService
                  , IOsmDataService osmDataService
                  , ILogger logger)
 {
     this._elevationService = elevationService;
     this._gltfService      = gltfService;
     this._meshService      = meshService;
     this._osmDataService   = osmDataService;
     this._logger           = logger;
 }
Beispiel #2
0
        public int GetCount(BoundingBox bbox, OsmLayer layers, DEMDataSet dataSet)
        {
            List <IOsmProcessor> processors     = Build(layers);
            IOsmDataService      osmDataService = _dataServiceFactory.Create(Settings.DataServiceType);
            int count = 0;

            foreach (var p in processors)
            {
                count += osmDataService.GetOsmDataCount(bbox, p.DataSettings);
            }

            return(count);
        }
 public void TestInitialize()
 {
     _graphHopperHelper = Substitute.For<IGraphHopperHelper>();
     _remoteFileFetcherGateway = Substitute.For<IRemoteFileFetcherGateway>();
     var factory = Substitute.For<IHttpGatewayFactory>();
     factory.CreateRemoteFileFetcherGateway(Arg.Any<TokenAndSecret>()).Returns(_remoteFileFetcherGateway);
     _remoteFileSizeFetcherGateway = Substitute.For<IRemoteFileSizeFetcherGateway>();
     _fileSystemHelper = Substitute.For<IFileSystemHelper>();
     _elasticSearchGateway = Substitute.For<IElasticSearchGateway>();
     _elasticSearchHelper = Substitute.For<INssmHelper>();
     _osmRepository = Substitute.For<IOsmRepository>();
     _osmGeoJsonPreprocessor = Substitute.For<IOsmGeoJsonPreprocessor>();
     _osmDataService = new OsmDataService(_graphHopperHelper, factory, _remoteFileSizeFetcherGateway, _fileSystemHelper,
         _elasticSearchGateway, _elasticSearchHelper, _osmRepository, _osmGeoJsonPreprocessor, Substitute.For<ILogger>());
 }
Beispiel #4
0
        public ModelRoot Run(ModelRoot model, OsmLayer layers, BoundingBox bbox, GeoTransformPipeline transform, bool computeElevations, DEMDataSet dataSet = null, bool downloadMissingFiles = true, bool withBuildingsColors = false, string defaultBuildingsColor = null)
        {
            model = model ?? _gltfService.CreateNewModel();

            if (layers == OsmLayer.None)
            {
                return(model);
            }

            IOsmDataService      osmDataService = _dataServiceFactory.Create(Settings.DataServiceType);
            List <IOsmProcessor> processors     = Build(layers, computeElevations, transform, withBuildingsColors, defaultBuildingsColor);

            foreach (var p in processors)
            {
                p.DataSettings.FlatGeobufTilesDirectory = Settings.FlatGeobufTilesDirectory;
                p.Init(_elevationService, _gltfService, _meshService, osmDataService, _logger);

                model = p.Run(model, bbox, computeElevations, dataSet, downloadMissingFiles);
            }

            return(model);
        }