Skip to content

Repository files navigation

README

Project Workflow: Physical Disturbance Analysis

This repository documents a reproducible workflow for analysing spatial datasets related to benthic habitat disturbance using QGIS (3.28.15) and R (4.4.2). The workflow follows the methodological basis of the 2023 OSPAR BH3a Indicator – Physical Disturbance to Benthic Habitats, integrating spatial processing and disturbance calculations applied to the Scottish context.


📑 Table of Contents


Overview

This project demonstrates how to process, analyse, and visualise spatial datasets used to calculate physical disturbance layers based on VMS (Vessel Monitoring System) data. The workflow switches between R for data processing and QGIS for spatial manipulation and map production.

Using the openly available source code and data from the OSPAR Convention's 2023 Quality Status Report BH3a indicator, ESS replicates the OSPAR process, but modifies the input layer relating to fishing, to simulate full closure to bottom-contact fishing vessels within the protected areas specified (in this case, within Scottish waters).

Further details about the methodology, assumptions and limitations are discussed in the ESS technical paper: https://environmentalstandards.scot/our-work/our-analytical-work/how-much-could-marine-protected-areas-contribute-to-good-environmental-status-development-of-a-practical-assessment-approach/


Software Requirements

Tool Version Notes
QGIS 3.28.15 Spatial processing & map production
R 4.4.2 Disturbance calculations, summarisation

Where possible, alternative code has been provided for users who do not have access to QGIS - e.g. all models are provided both in .model3 and .py format.


Data Sources required

The analysis has been carried out using publicly available open data sources.

The script: scripts/input-log.html provides details of each of the input layers used, and URLs for obtaining these.

The list includes - OSPAR public datasets, including cleaned VMS pressure layers (OSPAR 2023 Quality Status Report) - Scottish marine regions - Marine Protected Areas and Special Areas of Conservation (Scottish)


Directory Setup

Suggested project structure:

project_root/
├── scripts/
├── outputs/
├── spatial/
├── interim-analysis/
├── .RProj
├── .Renviron 
└── .Rprofile

Some spatial layers are contained within zip files and within a complex file structure. To keep the navigation simple within R, it is recommended that wherever these files are saved, a 'shortcut' directory path is set in the .Renviron path which allows only the .gpkg name to be used within the scripts.

e.g. ospar_geopackage <- "[direct path to gpkg folder set in .Renviron]/QSR2023_BH3_Disturbance_Layers_VMS.gpkg"

Data Preparation

These processes follow OSPAR’s 2023 BH3 methodology and depend on a suite of openly available spatial layers.

  1. Clone repository

  2. Update .Renviron to reflect local file directory paths, using .Renviron.example as a template.

  3. Download the datasets listed in input_files.html. Store files in DATA_DIR, or one of the other filepaths specified in .Renviron.

  4. Save .Rprofile from .Rprofile.example

-- note that R Studio should be fully closed and re-opened to allow changes made in .Renviron and .Rprofile to take effect.


QGIS Workflow 1

QGIS models are contained within the spatial folder.

QGIS tasks include:

  1. import spatial layers (specified in input_layers.html)
  2. identify relevant OSPAR layers and subregions
  3. intersect with Scottish marine regions
  4. identify relevant protected areas from 2015 Programme of Measures
  5. create layer which identifies all features which intersect with protected areas
  6. export layers produced during QGIS analysis to a geopackage within the relevant data directory you have specified in your .Renviron file.
  7. create look-up table to export for R analysis.

R Workflow

R tasks include:

  • disturbance calculations
  • aggregated pressure processing
  • sensitivity layer integration
  • summary statistics
  • production of clean output tables

To carry out these tasks, run scripts in the following order:

  1. Run scripts/setup.R

  2. Run scripts/disturbance_calculations.R

  3. Run scripts/creating_summaries.R

  4. Run scripts/broad_scale_habitats.R


QGIS Workflow 2

Following the R analysis, QGIS is used to generate final outputs.

Steps:

  1. Export .csv outputs from R.

  2. Import into QGIS.

  3. Re-join new disturbance calculations with layers from geopackage (outputted in QGIS Workflow 1): features_clipped_with_area_subregion_2018 / features_clipped_with_area_subregion_2025 layers

  4. Format to create visualisations (using disturb_group_style.qml)


Reproducibility Notes

  • Keep directory paths consistent.
  • Ensure environment variables load correctly.
  • Maintain consistent data types for join fields.
  • Do not rename QGIS layers used in downstream processing.

Contact ESS

If the above steps are not working, or you need some further information about the methodology used in this piece of analysis, please contact us.

About

Code accompanying ESS Technical Paper "How much could marine protected areas contribute to Good Environmental Status? Development of a practical assessment approach", published March 2026

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages