# Vector tile route finding

I've done this recently as I needed a method to calculate a million random routes at low cost for simulation purposes. What I did was download all the vector tiles in the area in which the route was relevant (bounding box or all tiles that intersect a buffered straight line path between the start/end). Then extracted the roads from the vector tiles and merged (union) them together to create a large MultiLineString. From there I used nettopology suite and shortest path algorithm to calculate a route. Note that this does not take into consideration turn and other road restrictions as that data typically is not in the tiles, but this would depend on the source of your vector tiles. You can avoid toll roads simply by excluding them from the MultiLineString. One way streets can be honored since the vector tiles need this information for rendering.