[{"data":1,"prerenderedAt":337},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fconcepts\u002Frouting-graph-and-costing":3,"_apollo:default":336,"_apollo:stationEditor":336,"_apollo:feedManagement":336,"_apollo:transferAnalyst":336},{"id":4,"title":5,"body":6,"description":327,"extension":328,"meta":329,"navigation":330,"path":331,"seo":332,"stem":333,"__hash__":334,"lastUpdated":335},"content\u002Fdocs\u002Fconcepts\u002Frouting-graph-and-costing.md","Routing graph and costing models",{"type":7,"value":8,"toc":319},"minimark",[9,24,29,62,93,96,123,138,142,149,156,265,269,275,282,295,299],[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","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","street routing",", ",[19,48,50],{"href":49},"\u002Fdocumentation\u002Frouting-platform\u002Fmatrix","matrix",[19,52,54],{"href":53},"\u002Fdocumentation\u002Frouting-platform\u002Fisochrone","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,78,82,83,87,88,92],{},[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","transit routing",". It is rebuilt every hour from each feed's ",[19,79,81],{"href":80},"\u002Fdocumentation\u002Fconcepts\u002Fstatic-gtfs-feed-versions#active-feed-version","active feed version",", so a new feed version is added within about two hours of becoming active. Within its ",[19,84,86],{"href":85},"\u002Fdocumentation\u002Frouting-platform\u002Ftransit-otp#coverage","real-time coverage",", transit routing also applies ",[19,89,91],{"href":90},"\u002Fdocumentation\u002Fconcepts\u002Fsource-feeds#gtfs-realtime-feed-fetching-and-caching","GTFS Realtime"," trip updates to the scheduled trips.",[10,94,95],{},"Because the graphs are separate:",[97,98,99,111,117],"ul",{},[100,101,102,105,106,110],"li",{},[14,103,104],{},"Transit routing is a separate endpoint."," The street endpoints do not route on transit. A street request with ",[107,108,109],"code",{},"costing=multimodal"," fails with an error that the locations are in unconnected regions.",[100,112,113,116],{},[14,114,115],{},"Coverage differs."," Street routing covers the world; transit routing covers the United States.",[100,118,119,122],{},[14,120,121],{},"Update frequency differs."," The street graph is rebuilt about daily; the transit graph is rebuilt hourly.",[124,125,126,131,132,137],"info",{},[19,127,130],{"href":128,"rel":129},"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,133,136],{"href":134,"rel":135},"https:\u002F\u002Fgithub.com\u002Finterline-io\u002Fvalhalla-docker",[39],"valhalla-docker","\n container image.\n",[25,139,141],{"id":140},"street-costing-models","Street costing models",[10,143,144,145,148],{},"A ",[14,146,147],{},"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,150,151,152,155],{},"Each street routing request sets a model with the ",[107,153,154],{},"costing"," parameter:",[157,158,159,171],"table",{},[160,161,162],"thead",{},[163,164,165,168],"tr",{},[166,167,154],"th",{},[166,169,170],{},"description",[172,173,174,185,195,205,215,225,235,245,255],"tbody",{},[163,175,176,182],{},[177,178,179],"td",{},[107,180,181],{},"auto",[177,183,184],{},"Automobile routing",[163,186,187,192],{},[177,188,189],{},[107,190,191],{},"bicycle",[177,193,194],{},"Bicycle routing",[163,196,197,202],{},[177,198,199],{},[107,200,201],{},"pedestrian",[177,203,204],{},"Walking\u002Fpedestrian routing",[163,206,207,212],{},[177,208,209],{},[107,210,211],{},"bus",[177,213,214],{},"Bus routing (to plan a hypothetical bus route that follows roads)",[163,216,217,222],{},[177,218,219],{},[107,220,221],{},"truck",[177,223,224],{},"Truck routing (avoids low clearances, weight limits)",[163,226,227,232],{},[177,228,229],{},[107,230,231],{},"motorcycle",[177,233,234],{},"Motorcycle routing",[163,236,237,242],{},[177,238,239],{},[107,240,241],{},"motor_scooter",[177,243,244],{},"Motor scooter routing (avoids freeways, tends to avoid hills)",[163,246,247,252],{},[177,248,249],{},[107,250,251],{},"taxi",[177,253,254],{},"Taxi\u002Frideshare routing (may use HOV\u002Fbus lanes)",[163,256,257,262],{},[177,258,259],{},[107,260,261],{},"bikeshare",[177,263,264],{},"Bikeshare routing (mix of bicycle and pedestrian)",[25,266,268],{"id":267},"dynamic-costing","Dynamic costing",[10,270,271,272,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,273,274],{},"dynamic costing",[10,276,277,278,281],{},"Options such as the penalty for unpaved surfaces, toll avoidance, wheelchair access for pedestrians, and a bicycle preference for quieter streets are ",[107,279,280],{},"costing_options"," values set on a single request.",[10,283,284,285,290,291,294],{},"For the full set of options each model accepts, see the ",[19,286,289],{"href":287,"rel":288},"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,292,293],{"href":44},"street routing endpoint page",", which lists them with their types and defaults.",[25,296,298],{"id":297},"see-also","See also",[97,300,301,306,313],{},[100,302,303,305],{},[19,304,22],{"href":21},": the endpoints that use these graphs.",[100,307,308,312],{},[19,309,311],{"href":310},"\u002Fdocumentation\u002Fconcepts\u002Fjourneys-and-itineraries","Journeys and itineraries",": results of transit routing.",[100,314,315,318],{},[19,316,317],{"href":70},"Source feeds",": where the transit graph's schedules come from.",{"title":320,"searchDepth":321,"depth":321,"links":322},"",2,[323,324,325,326],{"id":27,"depth":321,"text":28},{"id":140,"depth":321,"text":141},{"id":267,"depth":321,"text":268},{"id":297,"depth":321,"text":298},"Interline Routing Platform street and transit graphs, their coverage and update frequency, and Valhalla costing models such as auto, bicycle, and pedestrian.","md",{},true,"\u002Fdocs\u002Fconcepts\u002Frouting-graph-and-costing",{"title":5,"description":327},"docs\u002Fconcepts\u002Frouting-graph-and-costing","ZBsirH1_nsaxuI2SyOnUdeVfY-YNcJLJShNe-vpnEnA","2026-10-16T15:48:26-07:00","{}",1793614314805]