Пример #1
0
        /// <summary>
        /// Preprocesses the data from the given OsmStreamReader and converts it directly to a routable data source.
        /// </summary>
        /// <param name="source">The source stream.</param>
        /// <param name="tagsIndex">The tags index.</param>
        /// <param name="interpreter">The routing interpreter.</param>
        /// <returns></returns>
        public static RouterDataSource <Edge> Preprocess(OsmStreamSource source, ITagsIndex tagsIndex, IOsmRoutingInterpreter interpreter)
        {
            var routerDataSource =
                new RouterDataSource <Edge>(new Graph <Edge>(), tagsIndex);
            var targetData = new GraphOsmStreamTarget(routerDataSource, interpreter,
                                                      tagsIndex);

            targetData.RegisterSource(source);
            targetData.Pull();

            return(routerDataSource);
        }
Пример #2
0
 /// <summary>
 /// Preprocesses the data from the given OsmStreamReader and converts it directly to a routable data source.
 /// </summary>
 /// <param name="source">The source stream.</param>
 /// <param name="interpreter">The routing interpreter.</param>
 /// <returns></returns>
 public static RouterDataSource <Edge> Preprocess(OsmStreamSource source, IOsmRoutingInterpreter interpreter)
 {
     return(GraphOsmStreamTarget.Preprocess(source, new TagsIndex(), interpreter));
 }