Experimental

Finds the shortest path between start and end coordinates over a line network.

vector network shortest-path

Parameters

NameDescriptionRequiredDefault
inputInput line network layer.Requirednetwork.shp
start_xStart x coordinate.Required0.0
start_yStart y coordinate.Required0.0
end_xEnd x coordinate.Required100.0
end_yEnd y coordinate.Required100.0
snap_toleranceOptional node snapping tolerance for graph construction.Optional
max_snap_distanceOptional max distance from start/end coordinates to nearest network node.Optional
edge_cost_fieldOptional numeric line field used as an impedance multiplier for segment length.Optional
one_way_fieldOptional line field marking one-way digitized edges (true/1/yes means from first to second vertex only).Optional
blocked_fieldOptional line field marking blocked/closed edges to exclude from routing (true/1/yes blocks).Optional
barriersOptional barrier point layer; nearest network nodes are blocked from traversal.Optional
barrier_snap_distanceOptional max distance from each barrier point to a network node for blocking.Optional
turn_penaltyOptional additive cost applied to non-straight turns at network nodes.Optional
u_turn_penaltyOptional additive cost applied to U-turn transitions.Optional
forbid_u_turnsIf true, disallow U-turn transitions.Optional
forbid_left_turnsIf true, disallow left-turn transitions.Optional
forbid_right_turnsIf true, disallow right-turn transitions.Optional
turn_restrictions_csvOptional CSV of turn transitions using columns prev_x,prev_y,node_x,node_y,next_x,next_y. Optional columns: forbidden (default true when no turn_cost column is provided) and turn_cost (or penalty/cost/extra_cost) for per-turn additive cost.Optional
temporal_cost_profileOptional CSV defining time-dependent edge costs (columns: edge_id,dow,start_minute,end_minute,value).Optional
temporal_edge_id_fieldOptional network field used to match temporal_cost_profile edge_id values (default EDGE_ID).Optional
departure_timeOptional RFC3339 departure time used for temporal profile lookup.Optional
temporal_modeOptional temporal interpretation mode: multiplier or absolute.Optional
temporal_fallbackOptional fallback when temporal row is missing: static_cost or error.Optional
temporal_profile_reportOptional JSON output path for temporal profile diagnostics (coverage, unmatched edges, fallback usage).Optional
outputOutput line vector path.Required

Examples

Computes shortest path between two points on a line network.

wbe.shortest_path_network(end_x=100.0, end_y=100.0, input='network.shp', output='shortest_path.shp', start_x=0.0, start_y=0.0)

Project Links

WbW Homepage User Manual Learn More