Closed airbreather closed 5 years ago
With the help of git bisect
, I've been able to determine that this problem was introduced in 390e676.
With a tiny bit of investigation, I've determined that this code is using the API incorrectly. I should keep in mind that Itinero's public API is primarily intended to be used through extension methods that connect all the pieces together.
A corrected version of Program.cs
looks like this, which does not exhibit the issue:
using System.IO;
using Itinero;
using Itinero.Algorithms.Search.Hilbert;
using Itinero.IO.Osm;
using OsmSharp.Streams;
class Program
{
static void Main(string[] args)
{
// obviously, change these as appropriate to you:
const string InputPath = @"D:\planet-bits1.osm.pbf";
const string OutputPath = @"D:\repro.routerdb";
var routerDb = new RouterDb();
using (var inputStream = File.OpenRead(InputPath))
{
routerDb.LoadOsmData(new PBFOsmStreamSource(inputStream), Itinero.Osm.Vehicles.Vehicle.Car);
}
routerDb.Sort();
using (var outputStream = File.Create(OutputPath))
{
routerDb.Serialize(outputStream);
}
}
}
The following code works when
ItineroPackageVersion
is set to1.3.2
, but when I set it to1.3.3-ed4cd5a
(which is a local build of everything as of commit ed4cd5a using the provided.nuspec
files), it fails with the error described in #219, reproduced here (admittedly, I set<DebugType>embedded</DebugType>
so that this stack trace is more useful to you):This issue does not appear to be sensitive to the input; every file I've pushed through this code has this problem, including a few I tried from http://files.itinero.tech/data/OSM/planet/europe/ recently. If you have problems finding an input file that reproduces the issue, I can provide the 60 MB extract.
Program.cs
ConsoleApp0.csproj