itinero / routing

The routing core of itinero.
Apache License 2.0
221 stars 69 forks source link

Router.Calculate not working for long distances #202

Closed sameersb closed 6 years ago

sameersb commented 6 years ago

Testing on India osm data (400 MB routerdb)

    FileStream stream = new FileInfo(@"D:\Source\Routing\data\india-latest.routerdb").OpenRead();
    RouterDb routerDb = RouterDb.Deserialize(stream);
    stream.Close();
    Router router = new Router(routerDb);
    Profile profile = Itinero.Osm.Vehicles.Vehicle.Car.Fastest();
    RouterPoint routerPointStart = router.Resolve(profile, 32.732998f, 74.864273f);
    RouterPoint routerPointEnd = router.Resolve(profile, 8.088306f, 77.538452f);
    Route route = router.Calculate(profile,routerPointStart,routerPointEnd);

router.Calculate working for short distances like 200km - 300 km, but it does not work for long distances like 3000km, it takes long time and finally gives "Out of Memory exception". What could be the reason?

xivk commented 6 years ago

Doing routing on such long distances is best done using contraction, check the documentation here:

https://docs.itinero.tech/docs/itinero/basic-concepts/routerdb.html#contraction