Published March 13, 2025 | Version 2025
Software Open

VBA Code to analyze cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats: 2002-2024

Authors/Creators

  • 1. Jenness Enterprises

Description

This repository contains VBA and ArcObjects code used to analyze plant distributions in digitized quadrats near Flagstaff Arizona, over the years 2002 - 2024.  This code was used to produce the data presented in the Data Paper "Cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2024)" (Moore et al. 2025).

There are 264 VBA functions used in this project, distributed over 13 modules and comprising 25,655 lines of code.  The primary analytical master function is "RunAsBatch" in the module "H_WB_Analysis".  This function runs several other functions that do the various steps of the analysis. In particular:

  1. The function "OrganizeData" in module "H_WB_Analysis" assembles all original datasets into a single workspace with a common naming convention, and adds verbatim fields to keep track of edits made to data.
  2. The function "ReviseShapefiles" in module "H_WB_Analysis" corrects species misspellings and misidentifications.
  3. The function "ConvertPointShapefiles" in module "H_WB_Analysis" converts point features to small polygons, deletes a few extraneous objects, adds a few observations that were missed in the digitizing, switches species designations from Cover to Density or vice-versa if necessary, and rotates quadrats if they were mapped with the wrong orientation.
  4. The function "AddEmptyFeaturesAndFeatureClasses" in module "H_WB_Analysis" adds empty feature classes if a survey was done on that quadrat in that year but no features were found.  These empty feature classes distinguish these cases from times when no survey was conducted.
  5. The function "RepairOverlappingPolygons" in the module "More_Margaret_Functions" fixes cases when polygons for a single observation are digitized twice, or when separate polygons for a single species overlap.
  6. The function "RecreateSubsetsOfConvertedDatasets" in the module "More_Margaret_Functions" combines all newly-corrected feature classes into a new workspace, and creates two global feature classes containing all cover and all density observations.
  7. The function "AddEmptyFeaturesAndFeatureClassesToCleaned" in module "H_WB_Analysis" adds empty feature classes to the newly corrected feature classes if a survey was done on that quadrat in that year but no features were found.  These empty feature classes distinguish these cases from times when no survey was conducted.
  8. The function "ShiftFinishedShapefilesToCoordinateSystem" in module "H_WB_Analysis" correctly georeferences all feature classes and saves to a new workspace.  Prior to this step all plant locations were in a local 1-square-meter coordinate system based on the 1-square-meter quadrat.
  9. The function "ExportFinalDataset" in module "H_WB_Analysis" removes extraneous and verbatim fields, and exports the final version of the dataset to a new workspace.
  10. The function "SummarizeSpeciesBySite" in module "More_Margaret_Functions" analyzes all the feature classes to determine which species were observed at each site.
  11. The function "SummarizeSpeciesByCorrectQuadrat" in module "More_Margaret_Functions" analyzes all the feature classes to determine which species were observed at each quadrat.
  12. The function "SummarizeYearByCorrectQuadratByYear" in module "More_Margaret_Functions" analyzes all the feature classes to determine which quadrats were surveyed each year.
  13. The function "ExportSubsetsOfSpeciesShapefiles" in module "Margaret_Functions_3" extracts each species individually from the full dataset, and saves them in a series of nested folders suitable for Integral Projection Model functions in R.
  14. The function "CreateFinalTables" in module "H_WB_Analysis" produces the final summary tables intended for distribution with the data, including a list of plant species observed, a summary of the basal area per species by quadrat and year, summary data describing all quadrats and overstory plots, and tabular versions of the global cover and density feature classes.

The primary map export function is "ExportImages" in the module "Margaret", and is run separately from the 14 functions run in the batch file above. This map-making function creates common plant species symbology that can be applied to all 1,877 maps, and exports individual maps for each quadrat and for each year. This function is best run from an ArcMap document with no data in it, which is why it is run separately from the other functions.  Note: These functions are written in ArcObjects and VBA, and therefore can only be run in ArcMap.  ArcGIS Pro cannot run them.

Moore, M. M., J. S. Jenness, D. C. Laughlin, R. T. Strahan, J. D. Bakker, H. E. Dowling, and J. D. Springer. 2022. Cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2020). Ecology 103(5): e3661. https://doi.org/10.1002/ ecy.3661
 
Moore, M. M., Jenness, J. S, Laughlin, D. C., Strahan, R. T., Bakker, J. D., Dowling, H. E., and Springer, J. D. 2025. Cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2020+). Fort Collins, CO: Forest Service Research Data Archive. Updated February 2025.

Files

Files (978.9 kB)

Name Size Download all
md5:e82d739520600eaac5486e141e21d55b
25.3 kB Download
md5:debdd353de4174676b9fa64417a2278e
14.0 kB Download
md5:b792b6ac4289d8d1d7d8271a9af45e0d
430.3 kB Download
md5:061e9f54230f70bb7a352fa7b42380d4
8.2 kB Download
md5:8a73c7b7a4f0e10ae25b9cc77df6ceea
79.6 kB Download
md5:8b1fa721b4486bded49867cbb8faff5a
65.4 kB Download
md5:1127109faad86cffb5e0b107338ec58d
23.3 kB Download
md5:24b4b9a427ab124dc9a18b12ffbc896d
62.4 kB Download
md5:9dd6bcc83945ace11481120fc7a53722
113.4 kB Download
md5:c0575d1f8e1ea08493ce7dc849214ef1
106.5 kB Download
md5:39d074745b419e926004140c06f38b45
23.6 kB Download
md5:37245e45b626d9f4546e1c9f18de4484
9.6 kB Download
md5:3439c37fcefa9629ec9e6b08c7be40a2
17.3 kB Download

Additional details

References

  • Moore, M. M., J. S. Jenness, D. C. Laughlin, R. T. Strahan, J. D. Bakker, H. E. Dowling, and J. D. Springer. 2022. Cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2020). Ecology 103(5): e3661. https://doi.org/10.1002/ ecy.3661
  • JeffJenness. 2025. VBA Code to analyze cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats: 2002-2024. Zenodo. <https://doi.org/10.5281/zenodo.7581945>.
  • Moore, M. M., Jenness, J. S, Laughlin, D. C., Strahan, R. T., Bakker, J. D., Dowling, H. E., and Springer, J. D. 2025. Cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2020+). Fort Collins, CO: Forest Service Research Data Archive. Updated February 2025.