network_shortest_path_layer
Calculate the shortest or fastest route between two points on a line network layer using Dijkstra's algorithm. Supports one-way streets and speed fields for time-based routing.
Instructions
Find the shortest/fastest path between two points on your own line network layer.
Runs QGIS's native network-analysis algorithm (Dijkstra) on
network_layer_id - the layer must already be in the project (roads,
trails, etc.). start_point/end_point are [x, y] in that layer's CRS.
strategy is "shortest" (default, geometric length) or "fastest"
(needs speed_field, km/h, falling back to default_speed where
empty). direction_field supports one-way networks if the layer has
one. The resulting path is added to the project as a new line layer;
only a length/id summary is returned here.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| strategy | No | shortest | |
| end_point | Yes | ||
| tolerance | No | ||
| speed_field | No | ||
| start_point | Yes | ||
| default_speed | No | ||
| direction_field | No | ||
| network_layer_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||