Experimental
Selects k facilities and allocates demand points by network cost with greedy or exact solving, optional capacities, and required/forbidden candidate constraints.
vector network location-allocation allocation
| Name | Description | Required | Default |
|---|---|---|---|
input | Input line network layer. | Required | network.shp |
demand_points | Demand point layer to allocate. | Required | demand.shp |
facilities | Candidate facility point layer. | Required | facilities.shp |
facility_count | Number of facilities to select (k). | Required | 2 |
solver_mode | Solver mode: auto, greedy, or exact (exact is intended for smaller problems). | Optional | — |
demand_weight_field | Optional numeric demand weight field in demand_points (default weight=1). | Optional | — |
facility_capacity_field | Optional numeric capacity field in facilities; capacity is consumed by demand_weight_field values. | Optional | — |
required_facility_field | Optional boolean facility field marking candidates that must be selected. | Optional | — |
forbidden_facility_field | Optional boolean facility field marking candidates that must not be selected. | Optional | — |
snap_tolerance | Optional node snapping tolerance for graph construction. | Optional | — |
max_snap_distance | Optional max distance from demand/facility points to nearest network node. | Optional | — |
edge_cost_field | Optional numeric line field used as an impedance multiplier for segment length. | Optional | — |
one_way_field | Optional line field marking one-way digitized edges (true/1/yes means from first to second vertex only). | Optional | — |
blocked_field | Optional line field marking blocked/closed edges to exclude from routing (true/1/yes blocks). | Optional | — |
barriers | Optional barrier point layer; nearest network nodes are blocked from traversal. | Optional | — |
barrier_snap_distance | Optional max distance from each barrier point to a network node for blocking. | Optional | — |
turn_penalty | Optional additive cost applied to non-straight turns at network nodes. | Optional | — |
u_turn_penalty | Optional additive cost applied to U-turn transitions. | Optional | — |
forbid_u_turns | If true, disallow U-turn transitions. | Optional | — |
forbid_left_turns | If true, disallow left-turn transitions. | Optional | — |
forbid_right_turns | If true, disallow right-turn transitions. | Optional | — |
turn_restrictions_csv | Optional 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_profile | Optional CSV defining time-dependent edge costs (columns: edge_id,dow,start_minute,end_minute,value). | Optional | — |
temporal_edge_id_field | Optional network field used to match temporal_cost_profile edge_id values (default EDGE_ID). | Optional | — |
departure_time | Optional RFC3339 departure time used for temporal profile lookup. | Optional | — |
temporal_mode | Optional temporal interpretation mode: multiplier or absolute. | Optional | — |
temporal_fallback | Optional fallback when temporal row is missing: static_cost or error. | Optional | — |
temporal_profile_report | Optional JSON output path for temporal profile diagnostics (coverage, unmatched edges, fallback usage). | Optional | — |
output | Output allocated route line vector path. | Required | — |
Selects facilities and allocates demand points using network travel cost.
wbe.location_allocation_network(demand_points='demand.shp', facilities='facilities.shp', facility_count=2, input='network.shp', output='location_allocation_routes.shp')