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); }
public OsmHighwayProcessor(GeoTransformPipeline transform) : base(transform) { this.DataSettings = new HighwaysDataFilter(); }
public OsmPisteSkiProcessor(GeoTransformPipeline transformPipeline) : base(transformPipeline) { this.DataSettings = new PisteSkiDataFilter(); }
public OsmRailwayProcessor(GeoTransformPipeline transformPipeline) : base(transformPipeline) { this.DataSettings = new RailwayDataFilter(); }
public OsmWaterProcessor(GeoTransformPipeline transformPipeline) : base(transformPipeline) { this.DataSettings = new WaterDataFilter(); }
public OsmProcessorStage(GeoTransformPipeline transform) { this.Transform = transform?.Clone(); }
private List <IOsmProcessor> Build(OsmLayer layers, bool computeElevations = false, GeoTransformPipeline transform = null, bool withBuildingsColors = false, string defaultBuildingsColor = null) { List <IOsmProcessor> processors = new List <IOsmProcessor>(); if (layers.HasFlag(OsmLayer.Buildings)) { processors.Add(new OsmBuildingProcessor(transform, withBuildingsColors, defaultBuildingsColor)); } if (layers.HasFlag(OsmLayer.Railway)) { processors.Add(new OsmRailwayProcessor(transform)); } if (layers.HasFlag(OsmLayer.Water)) { processors.Add(new OsmWaterProcessor(transform)); } if (layers.HasFlag(OsmLayer.Highways)) { var processor = new OsmHighwayProcessor(transform); if (computeElevations) { processor.AddPostTransform(p => p.ZTranslate(_options.RenderGpxZTranslateTrackMeters)); } processors.Add(processor); } if (layers.HasFlag(OsmLayer.PisteSki)) { var processor = new OsmPisteSkiProcessor(transform); if (computeElevations) { processor.AddPostTransform(p => p.ZTranslate(_options.RenderGpxZTranslateTrackMeters)); } processors.Add(processor); } return(processors); }
public OsmBuildingProcessor(GeoTransformPipeline transformPipeline, bool withBuildingsColors, string defaultBuildingsColor) : base(transformPipeline) { this.withBuildingsColors = withBuildingsColors; this.defaultBuildingsColor = defaultBuildingsColor; this.DataSettings = new BuildingsDataFilter(); }