[{"data":1,"prerenderedAt":324},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fconcepts\u002Frouting-graph-and-costing":3,"_apollo:default":320,"_apollo:stationEditor":321,"_apollo:feedManagement":322,"_apollo:transferAnalyst":323},{"id":4,"title":5,"body":6,"description":312,"extension":313,"meta":314,"navigation":315,"path":316,"seo":317,"stem":318,"__hash__":319},"content\u002Fdocs\u002Fconcepts\u002Frouting-graph-and-costing.md","Routing Graph and Costing Models",{"type":7,"value":8,"toc":304},"minimark",[9,24,29,62,78,81,108,123,127,134,141,250,254,260,267,280,284],[10,11,12,13,17,18,23],"p",{},"Routing engines search a ",[14,15,16],"strong",{},"graph",": a network of edges with costs attached, built ahead of time from map or schedule data. The ",[19,20,22],"a",{"href":21},"\u002Fdocumentation\u002Frouting-platform\u002F","Interline Routing Platform"," uses two separate graphs.",[25,26,28],"h2",{"id":27},"street-and-transit-graphs","Street and transit graphs",[10,30,31,34,35,41,42,46,47,46,51,55,56,61],{},[14,32,33],{},"The street graph"," is built from ",[19,36,40],{"href":37,"rel":38},"https:\u002F\u002Fwww.openstreetmap.org",[39],"nofollow","OpenStreetMap"," and covers the world. It includes roads, paths, turn restrictions, surfaces, and elevation, and serves ",[19,43,45],{"href":44},"\u002Fdocumentation\u002Frouting-platform\u002Froute\u002F","street routing",", ",[19,48,50],{"href":49},"\u002Fdocumentation\u002Frouting-platform\u002Fmatrix\u002F","matrix",[19,52,54],{"href":53},"\u002Fdocumentation\u002Frouting-platform\u002Fisochrone\u002F","isochrone",", and the other street endpoints. It is rebuilt approximately daily from Interline Valhalla Tilepacks, which are built from the latest OpenStreetMap data and include ",[19,57,60],{"href":58,"rel":59},"https:\u002F\u002Fregistry.opendata.aws\u002Fterrain-tiles\u002F",[39],"Tilezen elevation tiles",".",[10,63,64,67,68,72,73,77],{},[14,65,66],{},"The transit graph"," is built from Transitland's archive of ",[19,69,71],{"href":70},"\u002Fdocumentation\u002Fconcepts\u002Fsource-feeds","GTFS source feeds"," and covers the United States. It includes stops, scheduled trips, and transfers, and serves ",[19,74,76],{"href":75},"\u002Fdocumentation\u002Frouting-platform\u002Ftransit-otp\u002F","transit routing",". New feed versions are added within minutes of import.",[10,79,80],{},"Because the graphs are separate:",[82,83,84,96,102],"ul",{},[85,86,87,90,91,95],"li",{},[14,88,89],{},"Transit routing is a separate endpoint."," The street endpoints do not route on transit. A street request with ",[92,93,94],"code",{},"costing=multimodal"," fails with an error that the locations are in unconnected regions.",[85,97,98,101],{},[14,99,100],{},"Coverage differs."," Street routing covers the world; transit routing covers the United States.",[85,103,104,107],{},[14,105,106],{},"Update frequency differs."," The street graph is rebuilt about daily; the transit graph updates within minutes of a new feed version.",[109,110,111,116,117,122],"info",{},[19,112,115],{"href":113,"rel":114},"https:\u002F\u002Fwww.interline.io\u002Fvalhalla\u002Ftilepacks\u002F",[39],"Interline Valhalla Tilepacks","\n are also available for organizations to deploy Valhalla in their own on-premises or cloud environments using Interline's \n",[19,118,121],{"href":119,"rel":120},"https:\u002F\u002Fgithub.com\u002Finterline-io\u002Fvalhalla-docker",[39],"valhalla-docker","\n container image.\n",[25,124,126],{"id":125},"street-costing-models","Street costing models",[10,128,129,130,133],{},"A ",[14,131,132],{},"costing model"," is the set of rules that converts the street network into travel costs for one mode. The same road can be fast for a car, prohibited for pedestrians, and penalized for bicycles.",[10,135,136,137,140],{},"Each street routing request sets a model with the ",[92,138,139],{},"costing"," parameter:",[142,143,144,156],"table",{},[145,146,147],"thead",{},[148,149,150,153],"tr",{},[151,152,139],"th",{},[151,154,155],{},"description",[157,158,159,170,180,190,200,210,220,230,240],"tbody",{},[148,160,161,167],{},[162,163,164],"td",{},[92,165,166],{},"auto",[162,168,169],{},"Automobile routing",[148,171,172,177],{},[162,173,174],{},[92,175,176],{},"bicycle",[162,178,179],{},"Bicycle routing",[148,181,182,187],{},[162,183,184],{},[92,185,186],{},"pedestrian",[162,188,189],{},"Walking\u002Fpedestrian routing",[148,191,192,197],{},[162,193,194],{},[92,195,196],{},"bus",[162,198,199],{},"Bus routing (to plan a hypothetical bus route that follows roads)",[148,201,202,207],{},[162,203,204],{},[92,205,206],{},"truck",[162,208,209],{},"Truck routing (avoids low clearances, weight limits)",[148,211,212,217],{},[162,213,214],{},[92,215,216],{},"motorcycle",[162,218,219],{},"Motorcycle routing",[148,221,222,227],{},[162,223,224],{},[92,225,226],{},"motor_scooter",[162,228,229],{},"Motor scooter routing (avoids freeways, tends to avoid hills)",[148,231,232,237],{},[162,233,234],{},[92,235,236],{},"taxi",[162,238,239],{},"Taxi\u002Frideshare routing (may use HOV\u002Fbus lanes)",[148,241,242,247],{},[162,243,244],{},[92,245,246],{},"bikeshare",[162,248,249],{},"Bikeshare routing (mix of bicycle and pedestrian)",[25,251,253],{"id":252},"dynamic-costing","Dynamic costing",[10,255,256,257,61],{},"Valhalla applies costing while the search runs, using parameters sent with each request. The graph stores network attributes, so changing costing does not require rebuilding it. This is called ",[14,258,259],{},"dynamic costing",[10,261,262,263,266],{},"Options such as the penalty for unpaved surfaces, toll avoidance, wheelchair access for pedestrians, and a bicycle preference for quieter streets are ",[92,264,265],{},"costing_options"," values set on a single request.",[10,268,269,270,275,276,279],{},"For the full set of options each model accepts, see the ",[19,271,274],{"href":272,"rel":273},"https:\u002F\u002Fvalhalla.github.io\u002Fvalhalla\u002Fapi\u002Fturn-by-turn\u002Fapi-reference\u002F#costing-models",[39],"Valhalla costing models reference",", or the request schema on any ",[19,277,278],{"href":44},"street routing endpoint page",", which lists them with their types and defaults.",[25,281,283],{"id":282},"see-also","See also",[82,285,286,291,298],{},[85,287,288,290],{},[19,289,22],{"href":21},": the endpoints that use these graphs.",[85,292,293,297],{},[19,294,296],{"href":295},"\u002Fdocumentation\u002Fconcepts\u002Fjourneys-and-itineraries","Journeys and Itineraries",": results of transit routing.",[85,299,300,303],{},[19,301,302],{"href":70},"Source Feeds",": where the transit graph's schedules come from.",{"title":305,"searchDepth":306,"depth":306,"links":307},"",2,[308,309,310,311],{"id":27,"depth":306,"text":28},{"id":125,"depth":306,"text":126},{"id":252,"depth":306,"text":253},{"id":282,"depth":306,"text":283},"Routing engines search a graph: a network of edges with costs attached, built ahead of time from map or schedule data. The Interline Routing Platform uses two separate graphs.","md",{},true,"\u002Fdocs\u002Fconcepts\u002Frouting-graph-and-costing",{"title":5,"description":312},"docs\u002Fconcepts\u002Frouting-graph-and-costing","2YFBXryUYnxJfqzOcX1xYXHZSJzycvdMInrFc__Dwro",{},{},{},{},1790811151526]