Example #1
0
        /// <summary>
        /// Merges all the given sources.
        /// </summary>
        /// <param name="sources">The sources.</param>
        /// <param name="resolutionType">The resolution type.</param>
        /// <returns>A merged stream.</returns>
        public static OsmStreamSource Merge(this IEnumerable <IEnumerable <OsmGeo> > sources,
                                            ConflictResolutionType resolutionType = ConflictResolutionType.FirstStream)
        {
            OsmStreamSource previous = null;

            foreach (var source in sources)
            {
                var osmSource = new OsmEnumerableStreamSource(source);

                if (previous == null)
                {
                    previous = osmSource;
                }
                else
                {
                    var next = new OsmStreamFilterMerge(resolutionType);
                    next.RegisterSource(previous);
                    next.RegisterSource(osmSource);

                    previous = next;
                }
            }

            return(previous);
        }
Example #2
0
        /// <summary>
        /// Merges the given sources into this source.
        /// </summary>
        public static OsmStreamSource Merge(this IEnumerable <OsmGeo> source, ConflictResolutionType resolutionType, params IEnumerable <OsmGeo>[] sources)
        {
            var osmSources = new OsmStreamSource[sources.Length];

            for (var s = 0; s < sources.Length; s++)
            {
                osmSources[s] = new OsmEnumerableStreamSource(sources[s]);
            }

            return(source.Merge(resolutionType, osmSources));
        }