# qgSurf

**qgSurf** is a QGIS plugin for structural and geological analysis, focused on the interaction between
**geological planes, surfaces, and topography**.

Rather than being a single-purpose tool, qgSurf provides a **coherent set of workflows**
to support geological reasoning directly inside a GIS environment.

The plugin is primarily aimed at **structural geologists, geomorphologists, seismologists,
and engineering geologists** who need to analyse field data, interpret planar structures,
and relate them to real topography.

---

## Core concepts

qgSurf is built around a few simple but powerful ideas:

- geological structures can be represented as **planes and surfaces**
- their relationship with topography can be **computed, visualised, and tested**
- profiles, intersections, and projections are essential tools for interpretation,
  not just for visualisation

---

## Main features

qgSurf allows users to:

- **derive the geological attitude of a plane** from three or more points (Best-Fit Plane)
- **compute the topographic trace of a geological plane** from its attitude and an origin point (DEM-plane intersection)
- **calculate distances** between points and geological planes (Plane distances from points/DEM cells)
- **analyse and visualise geological data using stereonets** (Stereonet)
- **build geological profiles** by projecting points, attitudes, line features, and polygonal
  units onto topographic sections (GeoProfiler)

These tools are designed to work together, enabling workflows such as:
field measurements → plane estimation → surface–topography interaction →
profile-based interpretation.

---

## GeoProfiler

The **GeoProfiler** module extends qgSurf towards the construction of
**geological cross-sections**.

It supports:

- single or multiple (parallel) topographic profiles
- non-straight profile traces following realistic geological paths
- projection of geological data (points, attitudes, faults, units) onto profiles
- configurable plotting for interpretation and presentation

GeoProfiler is designed to keep **data sources, results, and visual styles
conceptually separated**, allowing reproducible and reusable analyses.

---

## Stereonet analysis

qgSurf includes a stereonet plotting tool (imported and adapted from *geocouche*
by the same author), integrated with the rest of the plugin to support:

- visual inspection of structural datasets
- comparison between mapped data, fitted planes, and interpreted structures

---

## Typical workflows

qgSurf is designed around practical, geology-driven workflows rather than isolated tools.
Each module can be used independently, but they are most effective when combined.

---

### Geological cross-sections with GeoProfiler

A typical GeoProfiler workflow follows the logic commonly used by field and structural
geologists when constructing geological cross-sections.

1. **Define the topographic profile**
   
   - Digitise a profile trace directly on the map, or select an existing line.
   - Choose a DEM to sample elevation.
   - Optionally generate a set of **parallel profiles** to investigate lateral variations.
   - Profiles do not need to be straight lines and can follow realistic geological paths.

2. **Select the working 3D profile layer**
   
   - Load or select the 3D line layer containing one or more topographic profiles.
   - This step simply defines which profiles will be used for the analysis.

3. **Add geological information**
   
   - Project point data (e.g. measurements, events) onto the profile.
   - Project geological attitudes as planes intersecting the section.
   - Intersect line features (e.g. faults, fold axes) with the profile.
   - Intersect polygonal units to visualise lithological or geological domains along the section.
   - Projection distances and selection criteria are explicitly defined by the user.

4. **Plot and interpret**
   
   - Generate a configurable plot of the geological cross-section.
   - Adjust vertical exaggeration, colours, symbols, and labels.
   - Use the profile as an interpretation space to analyse structural relationships
     between geology and topography.

The resulting profile can be used for interpretation, comparison between parallel sections,
or exported for further analysis and sharing.

---

### Plane estimation and analysis (Best-Fit Plane)

1. Select a set of points representing a geological surface or feature.
2. Compute the best-fit plane from the selected points.
3. Inspect plane orientation and quality.
4. Use the resulting plane to:
   - compute topographic traces,
   - calculate distances of points from the plane,
   - compare with field measurements or mapped structures.

---

### Stereonet analysis

1. Load a dataset of geological attitudes.
2. Visualise orientations on a stereonet.
3. Compare measured data with:
   - best-fit planes,
   - interpreted structures,
   - subsets selected from the map or profiles.
4. Use the stereonet as a support for structural interpretation and quality control.

---

## Scope and philosophy

qgSurf is **not** intended to replace full 3D geological modelling software.
Instead, it aims to provide:

- transparent, reproducible computations
- tight integration with GIS data
- tools that reflect how structural geologists actually work with maps,
  sections, and measurements

---

## Status

qgSurf is under active development.
Some features are experimental and workflows may evolve as the plugin grows.

Contributions, testing, and feedback are welcome.

## Preprint

Alberti M. 2019. GIS analysis of geological surfaces orientations: the qgSurf plugin for QGIS. PeerJ Preprints 7:e27694v1 https://doi.org/10.7287/peerj.preprints.27694v1

## QGIS Python plugin repository

https://plugins.qgis.org/plugins/qgSurf/

## Contacts

Mauro Alberti 

alberti.m65@gmail.com