internal static void AddTiles(this TiledBarrierGraph graph, IEnumerable <uint> tiles, Func <uint, IEnumerable <OsmGeo> > getTile, Func <TagsCollectionBase, bool> isBarrier) { foreach (var tile in tiles) { // mark tile as loaded. graph.SetTileLoaded(tile); // get the data and load it. var tileData = getTile(tile); graph.Add(tileData, isBarrier); } // prune graph. graph.PruneDeadEnds(); graph.PruneShapePoints(); // standardize edges // loading them in a different order could lead to different start and end points graph.StandardizeEdges(); }