bcgov / castor

Castor - decision support model for forest and land management
Apache License 2.0
18 stars 14 forks source link

VQO Pre-processing module #433

Closed rhiand closed 2 days ago

rhiand commented 1 month ago

This functionality is supplied by Seles model VQOprep. Low priority but nice to have!

A data pre-processing model that takes as parameters the following rasters: Visual Quality Polygons: value = polygon id Visual Quality Objectives: value = visual quality identifier Slope Percent

Attribute table: Visual Quality Polygons: id mapping to visual polygon character id Visual Quality Objectives: id mapped to VQO (Preservation, Retention, Partial Retention, Modification, Maximum Modification)

Seles VQO prep iterates through Area of Interest, using a tracking array variable: vli[] = tracking array with length 6

vli[0]: visual quality polygon id

vli[1]: total area of visual polygon (sum of each 1-ha pixel)

vli[2]: total VEG (see below) (sum of VEG value for each 1-ha pixel) (VEG is green up height)

vli[3]: total P2P (see below) (sum of P2P value for each 1-ha pixel) (P2P is plan to perspective value based on slope percentages)

vli[4]: total VQO (see below) (sum of VQO value for each 1-ha pixel) (numeric VQO value mapping to VQO above)

Final output is: Polygon ID: vli[0]

Total Area in Polygon: vli[1]

VQO: VQO of Polygon

VQO: Mean VQO value - this should be the VQO value, as the rasterizaion process should assign all hectares within the same polygon id the same VQO.

VEG Height: vli[2] / vli[1], or total VEG value divided by total hectares, the mean VEG for the polygon.

P2P: vli[3] / vli[1], or total P2P value divided by total hectares, the mean P2P for the polygon.

Two more columns are added to output.

VSU is the categorical label for the visual quality polygon ID. In Seles, this comes from the cat file. This step could be included in the Castor pre-processing model.

midpoint is the visual quality polygon target, or percentage. It is calculated by mulitplying the P2P value generated by the model with the VQO percent alteration value.

The VQO percent alteration values are based on the range of permissible percent alteration in perspective views (Table 3, Bulletin – Modelling Visuals in TSR III). In Kootenay Lake, the mid point was selected (see Table 41, Data Package).

Since these values are pre-determined by VQO, there is no reason this step could not be included in the Castor model. One approach would be to use an input file if it existed, and if it didn't, use the mid-point value. Should someone want to run a different set of percent alteration values, they would just need to add the input file.

VQO Constraint

Zone = VQO polygon id (vli[0])

Percentage = midpoint (added column above)

Threshold = VEG Height (in Seles, height is in decimeters - so VEG needs to be multiplied by 10.

KyleLochhead commented 1 month ago

@rhiand here is a proposed workflow

  1. Create a SpaDES module - called p2pVQOCastor using the SpaDES module template.
  2. Create parameters for p2pVQOCastor that specify the inputs: the plan to perspective (P2P) table, the veg height by slope class, the slope raster, VQO polygon id, constraint set table.
  3. Calculate in the Init stage of the sim -- for each VQO polygon estimate the plan to perspective (P2P) which is the area weighted average of P2P by slope class - which is specified in the P2P table - we can set a default table, if not specified.
  4. Multiply the constraint percentage in the constraint set table by the polygon level estimated P2P.
rhiand commented 1 month ago

Questions (discussed but here for future reference).

Does this apply to all VQO polygons - e.g., those with PR and R objectives? Yes - all VQO polygons applied to CFLB

This module only gets run once during the "building of the resultant" - SQLite castordb? Yes

Does the P2P ratio by slope class get changed by the user? No

Can we use a function instead of slope classes to make the adjustment? The values for VEG and P2P come from references below, by slope class.

VEG values come from table 6 from Procedures for Factoring Visual Resources into Timber Supply Analyses

P2P values come from Table 4 from Bulletin – Modelling Visuals in TSR III).

The final visual quality polygon target is the P2P multiplied by the VQO percent alteration value - which is a range value from Table 3 from Bulletin – Modelling Visuals in TSR III).

Generally, think the midpoint of that range is selected as the percent alteration, but since the bulleting says a value within the range is acceptable, it would be good to maintain the ability for the user to change the value of the VQO percent alteration value. BUT - also good to, by default, set that value as the midpoint and not require an additional manual step.

Here is the code in StTSM:

RETURNTIME RETURNTIME = 0

OVER REGION WHOLE MAP ? VLI > 0 vliInfo[VLI,0] = vliInfo[VLI,0] + HaPerCell

  IF ForestCover > 0
     vliInfo[VLI,1] = vliInfo[VLI,1] + HaPerCell
     vliInfo[VLI,4] = vliInfo[VLI,4] + HaPerCell*VQO

     VEG = IF SlopePct <= 5 THEN 3
           ELSE IF SlopePct <= 10 THEN 3.5
           ELSE IF SlopePct <= 15 THEN 4
           ELSE IF SlopePct <= 20 THEN 4.5
           ELSE IF SlopePct <= 25 THEN 5
           ELSE IF SlopePct <= 30 THEN 5.5
           ELSE IF SlopePct <= 35 THEN 6
           ELSE IF SlopePct <= 40 THEN 6.5
           ELSE IF SlopePct <= 45 THEN 6.5
           ELSE IF SlopePct <= 50 THEN 7
           ELSE IF SlopePct <= 55 THEN 7.5
           ELSE IF SlopePct <= 60 THEN 8
           ELSE 8.5
     VisEffGrnHtdm  = VEG*10
     vliInfo[VLI,2] = vliInfo[VLI,2] + HaPerCell*VEG

     P2P = IF SlopePct <= 10 THEN 4.68
           ELSE IF SlopePct <= 20 THEN 3.77
           ELSE IF SlopePct <= 30 THEN 3.04
           ELSE IF SlopePct <= 40 THEN 2.45
           ELSE IF SlopePct <= 50 THEN 1.98
           ELSE IF SlopePct <= 60 THEN 1.60
           ELSE IF SlopePct <= 70 THEN 1.29
           ELSE 1.04
     vqoP2PRatio100 = P2P * 100
     vliInfo[VLI,3] = vliInfo[VLI,3] + HaPerCell*P2P
  END

END

OVER INDEX(1,maxVLI) vli = Index vqo = ROUND(vliInfo[vli,4] / vliInfo[vli,1]) OUTPUT(vliFile) vli aTot: vliInfo[vli,0] aFor: vliInfo[vli,1] vqo: $vqo {VQO} vqoMn: vliInfo[vli,4] / vliInfo[vli,1] VEGht: vliInfo[vli,2] / vliInfo[vli,1] P2P: vliInfo[vli,3] / vliInfo[vli,1] END END

KyleLochhead commented 2 days ago

Replicated SELES-STSM VQO adjustment for Kootenay Lake. Need to revisit using a 5% slope class for VEG height but only a 10% slope class for P2P.