Esempio n. 1
0
        /// <summary>
        /// Creates a new referenced Osm encoder.
        /// </summary>
        /// <param name="folder">The folder containing the shapefile(s).</param>
        /// <param name="searchPattern">The search pattern to identify the relevant shapefiles.</param>
        /// <param name="rawLocationEncoder">The raw location encoder.</param>
        /// <returns></returns>
        public static ReferencedOsmEncoder Create(string folder, string searchPattern, Encoder rawLocationEncoder)
        {
            // create an instance of the graph reader and define the columns that contain the 'node-ids'.
            var graphReader = new ShapefileLiveGraphReader("JTE_ID_BEG", "JTE_ID_END");
            // read the graph from the folder where the shapefiles are placed.
            var graph = graphReader.Read(folder, searchPattern, new ShapefileRoutingInterpreter());

            return(ReferencedOsmEncoder.Create(new BasicRouterDataSource <LiveEdge>(graph), rawLocationEncoder));
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new referenced Osm encoder.
 /// </summary>
 /// <param name="graph">The graph containing the Osm network.</param>
 /// <returns></returns>
 public static ReferencedOsmEncoder CreateBinary(BasicRouterDataSource <LiveEdge> graph)
 {
     return(ReferencedOsmEncoder.Create(graph, new OpenLR.Binary.BinaryEncoder()));
 }
Esempio n. 3
0
 /// <summary>
 /// Creates a new referenced Osm encoder.
 /// </summary>
 /// <param name="folder">The folder containing the shapefile(s).</param>
 /// <param name="searchPattern">The search pattern to identify the relevant shapefiles.</param>
 /// <returns></returns>
 public static ReferencedOsmEncoder CreateBinary(string folder, string searchPattern)
 {
     return(ReferencedOsmEncoder.Create(folder, searchPattern, new OpenLR.Binary.BinaryEncoder()));
 }