I have a model that I have built to automate the process of assessing wind hazard on forested edges.
Currently I can run it successfully but:
- I have to run it once, create the Test layer, and then run it a second time for Offset_Azimuth Calc to complete
- Offset_Azimuth Calc expression like so: (referencing the 'Test' layer)
degrees(
with_variable(
'line',
shortest_line (
centroid (
array_first(
overlay_nearest(
'Test',
$geometry
)
)
),
$geometry
),
azimuth (
start_point (@line),
end_point (@line)
)
)
)
I have tried the following, but I think I must be misunderstanding something here - I think it should easier than I am making it.
- Separate the model into two, a "prep" model that explodes the lines and assigns azimuth to each segment, and an "assessment" model that has Exploded_Boundary as an input (from prep) and referencing the "Exploded_Boundary" layer within the offset_azimuth calc expression. This will only work if the layer from prep is saved accordingly, and is less ideal for sharing with coworkers.
I have been unsuccessful in my attempt of making it a single model with 2 inputs, and 1 output (wind_hazard). I have tried using Wind_Hazard_Prep within the second Assessment model, but that did not work either - I could not reference the Wind_Hazard_Prep output from within the Offset_Azimuth Calc expression.
I see that there is a workaround by using Join Attribute by nearest, but I cannot figure out how to add and calculate the offset_azimuth field with it, as the problem here is that I cannot reference the exploded lines layer and the Intersection_OUTPUT (point layer) at the same time


