private List <ICompleteOsmGeo> GetRailways(OsmCompleteStreamSource osm) { return(osm.Where(x => x.Type == OsmGeoType.Way && x.Tags != null && x.Tags.ContainsKey("railway")) .ToList()); }
/// <summary> /// Creates a geometry interpreter stream source. /// </summary> /// <param name="completeSource"></param> /// <param name="featureInterpreter"></param> public FeatureInterpreterStreamSource(OsmCompleteStreamSource completeSource, FeatureInterpreter featureInterpreter) { _featureInterpreter = featureInterpreter; _completeSource = completeSource; _nextFeatures = new List<Feature>(); }
public void Create(OsmCompleteStreamSource src, Point offset, string outputDir) { var buildings = GetBuildings(src); var centroids = buildings.Select(x => GetCentroid((CompleteWay)x)).ToList(); var elevations = GetBuildingElevations(centroids); CreateBuildings(buildings, centroids, elevations, offset, outputDir); }
private static void OpenOsmFile(string osmPath) { var fs = File.OpenRead(osmPath); Console.WriteLine("Opening osm file"); var stream = new XmlOsmStreamSource(fs); osm = stream.ToComplete(); }
public void Create(OsmCompleteStreamSource osm, Point offset) { UpdateProgressMessage("[Railways] Creating railways"); UpdateProgress(0); var railways = GetRailways(osm); int progressReportInterval = 16; for (int i = 0; i < railways.Count; i++) { var rail = (CompleteWay)railways[i]; var nodes = Utils.ProjectWayWithLineElevation(rail, offset, projection, elevation); AddRailwayToMap(rail, nodes); if (i % progressReportInterval == 0) { UpdateProgress((float)(i + 1) / railways.Count); } } }
public OsmFeatureStreamSource(OsmCompleteStreamSource source, FeatureInterpreter interpreter) { this._source = source; this._interpreter = interpreter; }
public OsmFeatureStreamSource(OsmCompleteStreamSource source) { this._source = source; this._interpreter = (FeatureInterpreter) new SimpleFeatureInterpreter(); }
private List <ICompleteOsmGeo> GetBuildings(OsmCompleteStreamSource osm) => osm.Where(x => x.Type == OsmGeoType.Way && x.Tags != null && x.Tags.ContainsKey("building")) .ToList();
/// <summary> /// Registers a simple source on this target with a given cache. /// </summary> /// <param name="source"></param> /// <param name="cache"></param> public void RegisterSource(OsmStreamSource source, OsmDataCache cache) { _source = new OsmSimpleCompleteStreamSource(source, cache); }
/// <summary> /// Registers a simple source on this target. /// </summary> /// <param name="source"></param> public void RegisterSource(OsmStreamSource source) { _source = new OsmSimpleCompleteStreamSource(source); }
/// <summary> /// Registers a source on this target. /// </summary> /// <param name="source"></param> public void RegisterSource(OsmCompleteStreamSource source) { _source = source; }
/// <summary> /// Creates a new OSM feature stream source. /// </summary> /// <param name="source">The OSM source stream.</param> /// <param name="interpreter">The interpreter used to translate OSM-data into features.</param> public OsmFeatureStreamSource(OsmCompleteStreamSource source, FeatureInterpreter interpreter) { _source = source; _interpreter = interpreter; }
/// <summary> /// Creates a new OSM feature stream source. /// </summary> /// <param name="source">The OSM source stream.</param> public OsmFeatureStreamSource(OsmCompleteStreamSource source) { _source = source; _interpreter = new SimpleFeatureInterpreter(); }
/// <summary> /// Creates a new feature stream source. /// </summary> public InterpretedFeatureStreamSource(OsmCompleteStreamSource source, FeatureInterpreter interpreter) { _source = source; _interpreter = interpreter; }