Ejemplo n.º 1
0
        /// <summary>
        /// Preprocesses the data from the given OsmStreamReader and converts it directly to a routable data source.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="tagsIndex"></param>
        /// <param name="interpreter"></param>
        /// <returns></returns>
        public static DynamicGraphRouterDataSource <LiveEdge> Preprocess(OsmStreamSource reader,
                                                                         ITagsIndex tagsIndex,
                                                                         IOsmRoutingInterpreter interpreter)
        {
            var dynamicGraphRouterDataSource =
                new DynamicGraphRouterDataSource <LiveEdge>(tagsIndex);
            var targetData = new LiveGraphOsmStreamTarget(dynamicGraphRouterDataSource, interpreter,
                                                          tagsIndex);

            targetData.RegisterSource(reader);
            targetData.Pull();

            return(dynamicGraphRouterDataSource);
        }