You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using nuget packages version 1.5.0.
Below is code that I used. Similar code on same machine using Osm.Routing.dll (v0.4.5.143) finished in 5 minute:
static void PrepareDatabase()
{
var routerDb = new RouterDb();
Console.WriteLine(DateTime.Now);
Console.WriteLine("Loading from pbf");
// file downloaded from "https://download.geofabrik.de/russia-latest.osm.pbf"
using (var stream = new FileStream(@"C:\Maps\russia-latest.osm.pbf", FileMode.Open, FileAccess.Read, FileShare.Read, 1048576))
{
routerDb.LoadOsmData(stream, false, Vehicle.Car);
}
Console.WriteLine(DateTime.Now);
Console.WriteLine("Adding contracted Car");
routerDb.AddContracted(Vehicle.Car.Shortest()); // <-- OutOfMemory here (9GB memory)
Console.WriteLine(DateTime.Now);
Console.WriteLine("Saving database to memory");
using (var stream = new System.IO.MemoryStream())
{
routerDb.Serialize(stream, true);
Console.WriteLine(DateTime.Now);
Console.WriteLine("Saving database to disk");
using (var fileStream = new FileStream(@"C:\Maps\russia-latest.osm.pbf.router", FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
{
stream.Position = 0;
stream.CopyTo(fileStream);
}
}
Console.WriteLine(DateTime.Now);
Console.WriteLine("Finished");
}
The text was updated successfully, but these errors were encountered:
I am using nuget packages version 1.5.0.
Below is code that I used. Similar code on same machine using Osm.Routing.dll (v0.4.5.143) finished in 5 minute:
The text was updated successfully, but these errors were encountered: