USFS-PNW / Fia-Biosum-Manager

User interface and main code repository for Biosum
http://biosum.info/
Other
3 stars 3 forks source link

FVS: Update Tree Species Edit screen to accommodate 4 digit species code #319

Closed lbross closed 1 month ago

lbross commented 5 months ago

From @jsfried: Tree Species audit found a species 7454 (English holly) in two variants. I believe this is a result of FIA expanding to urban inventory which generates a huge list of species not native to the U.S. These are 4 digit species and the Tree Species audit does not have the ability to choose a species crosswalk for a 4 digit species. I don’t know that we tally ALL exotic species in the wildland (outside the urban) inventory but maybe those on an invasives list we do. We will need to add the ability to account for these—maybe call them all other tree or other hardwood? Or perhaps we develop a new species code for exotics (Exotic tree, code 9999 or some such) to map these into.

lbross commented 5 months ago

I found that spcd is treated as a number throughout BioSum so accommodating a 4 digit species code won't require any table schema changes (the hard part). I did confirm that the max length of the FIA Tree Species field on the Tree Species Edit screen is 3. It's an easy change to increase this to 4.

It's up to @jsfried how to map these in the fvs_tree_species table and to add them to the FIA_TREE_SPECIES_REF (if desired). But they should fold into our existing tree species processing fine once we increase that field length on the screen. These changes should be made with the same release.

lbross commented 5 months ago

Maintaining these rarely used species in our tree matrices would be a lot of work for not much gain. We are considering converting any 4-digit species codes to a generic species code when the trees are loaded into the plot table.

lbross commented 4 months ago

I am about to increase the max length of the FIA Tree Species field on the Tree Species Edit screen from 3 to 4. This is a workaround until we are able to add the automated fix to convert any 4-digit species codes to 998. To use this workaround the offending tree species codes must be added to the FIA_TREE_SPECIES_REF table before BioSum can add them to the tree_species table. Adding them to FIA_TREE_SPECIES_REF will be a manual process. These offending codes will show up as failed on the tree_species audit. Once they are in the FIA_TREE_SPECIES_REF table, you can use the button on the audit screen to add them to the tree species table. Once they're in the tree species table, you can use the Tree Species Edit screen to map them to 998. This all goes away when we implement the automated fix because they will come in as 998 when loaded to the master.tree table.

lbross commented 1 month ago
  1. There is a project-specific tree_species table in the /db/ref_master.mdb. This table is copied from the /db directory in the Program Files\FIA Biosum directory when a project is created.
  2. The bottom half of the Tree Species Audit screen reflects the contents of this project-specific table. It includes all variants. You can edit most attributes of any record on this table using edit button on a record in the table. Most times you would only want to edit the FVS Tree Species.
  3. When you run the audit, the top half of the screen is populated by a compound query across the master.tree, tree_species, and FIA_TREE_SPECIES_REF tables. The latter is found in the AppData/biosum_ref.accdb. Because this table is part of the audit query, these 4-digit species codes need to be added to FIA_TREE_SPECIES_REF to get them to show up on the audit.
  4. There is a glitch in the audit where some variant/species codes appear even if there are records in the tree_species table. If there aren't checkboxes in the first column of the audit, these occurrences can be ignored.
  5. There will be a checkbox in the audit if there is a species in master.tree that isn't found in the tree_species table. BioSum provides the capability to add them to the tree_species table by checking the box and clicking the button.

So ... to validate this issue, you need to:

  1. Have a record in master.tree with a 4-digit species code (either modify or create)
  2. Add that 4-digit species code to AppData\biosum_ref.accdb
  3. Run the audit. This should make the new species code appear in the top half of the screen with a checkbox
  4. Add the species to the tree_species table using the button
  5. Edit the new row in the bottom half of the screen to map that species to a generic FVS species code.
lbross commented 1 month ago

From Nathan P. : I took a look at the issue using the link you provided yesterday, followed the directions you posted there yesterday, and successfully added a 4-digit species code on the Tree Species Edit page, as shown in the screenshot, below. This suggests that issue #319 is resolved.