Mapped Chart Quadrats VBA Code: 2023
Description
This repository contains VBA and ArcObjects code used to analyze plant distributions in digitized quadrats near Flagstaff Arizona, over the years 2002 - 2023. This code was used to produce the original data presented in the Data Paper "Cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2020)" (Moore et al. 2022; see also https://doi.org/10.2737/RDS-2021-0092), and additional functions included in 2023 update the original dataset by adding two new years worth of data and correct a few species misidentifications from previous years.
The relevant functions are embedded in larger modules containing other unused functions (14 VBA modules containing 747 functions and 72,608 lines of code). The primary analytical master function is "RunAsBatch" in the module "ThisDocument_for_VM_2". This function runs several other functions that do the various steps of the analysis. In particular:
- The function "OrganizeData" in module "ThisDocument_for_VM_2" 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.
- The function "ReviseShapefiles" in module "ThisDocument_for_VM_2" corrects species misspellings and misidentifications.
- The function "ConvertPointShapefiles" in module "ThisDocument_for_VM_2" 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.
- The function "AddEmptyFeaturesAndFeatureClasses" in module "ThisDocument_for_VM_2" 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.
- 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.
- 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.
- The function "AddEmptyFeaturesAndFeatureClassesToCleaned" in module "ThisDocument_for_VM_2" 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.
- The function "ShiftFinishedShapefilesToCoordinateSystem" in module "ThisDocument_for_VM_2" 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.
- The function "ExportFinalDataset" in module "ThisDocument_for_VM_2" removes extraneous and verbatim fields, and exports the final version of the dataset to a new workspace.
- The function "SummarizeSpeciesBySite" in module "More_Margaret_Functions" analyzes all the feature classes to determine which species were observed at each site.
- The function "SummarizeSpeciesByCorrectQuadrat" in module "More_Margaret_Functions" analyzes all the feature classes to determine which species were observed at each quadrat.
- The function "SummarizeYearByCorrectQuadratByYear" in module "More_Margaret_Functions" analyzes all the feature classes to determine which quadrats were surveyed each year.
- 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.
- The function "CreateFinalTables" in module "ThisDocument_for_VM_2" 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 "Quadrat_Map_Module", 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,700 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.
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. Data Paper. https://doi.org/10.1002/ecy.3661
Files
Mapped_Chart_Quadrats_VBA_Code-main_2023.zip
Files
(397.3 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:ccb9a7b145277a1f8a095abcf12f4ed6
|
397.3 kB | Preview 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. 2021. Cover and density of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2020). Ecology.
- Moore, M. M., J. S. Jenness, D. C. Laughlin, R. T. Strahan, J. D. Bakker, H. E. Dowling, and J. D. Springer. 2021. Cover and density data of southwestern ponderosa pine understory plants in permanent chart quadrats (2002-2020+).
- JeffJenness. 2021. Mapped Chart Quadrats VBA Code. Zenodo. <https://doi.org/10.5281/zenodo.5567814>.