Skip to content

Instantly share code, notes, and snippets.

@xivk
Created May 8, 2014 08:18
Show Gist options
  • Save xivk/5e8b05ac5b303df04688 to your computer and use it in GitHub Desktop.
Save xivk/5e8b05ac5b303df04688 to your computer and use it in GitHub Desktop.
OsmSharp - Loading a routing flatfile
// for contracted files:
TagsCollectionBase metaTags;
var serializer = new OsmSharp.Routing.CH.Serialization.CHEdgeFlatfileSerializer();
var data = serializer.Deserialize(
new FileInfo(file_name_string_here).OpenRead(), out metaTags, false);
var router = Router.CreateCHFrom(data, new CHRouter(), interpreter);
// for regular files:
TagsCollectionBase metaTags;
var serializer = new OsmSharp.Routing.Osm.Graphs.Serialization.LiveEdgeFlatfileSerializer();
var data = serializer.Deserialize(
new FileInfo(file_name_string_here).OpenRead(), out metaTags, false);
var router = Router.CreateLiveFrom(data,
new DykstraRoutingLive(), interpreter);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment