GeoProfiler – Help

Plugin authors: M. Alberti, M. Zanieri
Concept: M. Zanieri
Implementation: M. Alberti

Overview

GeoProfiler helps you build geological profiles by integrating topography and georeferenced geological data (points, attitudes, focal mechanisms, lines, polygons) into a reproducible workflow.

It is part of qgSurf and evolves from the standalone qProf plugin, with a largely rewritten architecture.

The GeoProfiler command tree
Fig. 1. The module interface, with the various commands NOT expanded. The current tree is organized as numbered steps (0 - Create 3D topographic profile6 - Import geoprofile).

Quickstart (2 minutes)

If you just want to create a geological profile quickly. The steps below are the numbered branches of the command tree (Fig. 1), in the order they are meant to be run, and each command is started by double-clicking it in the tree.

0. Create a 3D topographic profileSKIP IF YOU ALREADY HAVE ONE

This whole step only builds the 3D line layer that carries the topography. If you already have one - generated in an earlier session, or produced by any other means, as long as it is a 3D line layer - just load it into QGIS and go straight to step 1.
The GeoProfiler command tree
Fig. 2. The module interface for step: '0 - Create 3D topographic profile', with the various commands expanded..

Run the four commands under 0 - Create 3D topographic profile (Fig. 2), in this order:

  1. Define output storage geopackage: the GeoPackage, and the 3D line layer inside it, that the generated profile will be written to. Pick one of Create new geopackage with empty 3D line layer, Create new 3D line layer in existing geopackage or Append to existing 3D line layer in geopackage.
  2. Create 2D profile trace: Load trace from 2D line layer, or Digitize 2D trace in canvas.
  3. Define DEM as elevation source: one of the single-band rasters loaded in the project.
  4. Generate 3D profile: samples the DEM along the trace and writes the 3D line(s) to the storage layer, each named profile 1, profile 2, ... in a profile_name field.
A 3D line layer created here carries a profile_name text field, filled with a progressive name as each profile is written and continued when more are appended later. It is an ordinary attribute: rewrite it in the QGIS attribute table to call a profile what you call it on the map, and Section Editor will title its section with that. A layer created by an earlier version, or brought in from elsewhere, simply has no such field - it can still take generated profiles, only without a name.
The storage is mandatory, and has to be defined before Generate 3D profile is run: it is where the profile is written. Without it the run has nowhere to write and the profile is lost - the tool still reports the profile as generated, and only the "qgSurf" log panel records that nothing was stored.

1. Choose the working profile

This is the first step for everyone: whether the 3D layer was just generated in step 0 or brought in ready-made, it becomes the reference geometry only once it is chosen here.

2. Add geological data

The GeoProfiler command tree
Fig. 3. The module interface for step: '2 - Define geodata to add', with the various commands expanded..

Under 2 - Define geodata to add (Fig. 3), as many as you need:

3. (Optional) Set graphical parameters

The GeoProfiler command tree
Fig. 4. The module interface for step: '3 - Set graphical parameters', with the various commands expanded..
Skipping this plots everything with the default styles.

4. Plot

You now have a geological profile.

5. (Optional) Save your work

Reload later with 6 - Import geoprofile.

Minimal requirements

or, to build one in step 0:

Quick Example (field use)

Create a GeoPackage to store the profile in, digitize a profile across an Apennine ridge, select a DEM, and generate the 3D profile. Choose it as the working profile, then project bedding attitudes and intersect mapped fault traces. Plot the profile to visualize the relationships between stratification and tectonic structures.

Next time, with the 3D profile layer already in the GeoPackage, the same section is replotted by loading that layer and choosing it as the working profile - no DEM sampling involved.

Workflow Overview (visual)

          ┌── step 0: only if you have no 3D profile layer yet ──┐
          │                                                      │
          │  [Storage geopackage]     [Trace (2D/3D)]     [DEM]  │
          │           │                      │              │    │
          │           └───────────┬──────────┴──────────────┘    │
          │                       ▼                              │
          │              Generate 3D profile                     │
          └───────────────────────┬──────────────────────────────┘
                                  ▼
                         [3D profile layer]  ◀── or one you already have
                                  │
                                  ▼
                       Choose working profile
                                  │
                                  ▼
                         Add geological data
                         ├─ Points (projection)
                         ├─ Attitudes (projection)
                         ├─ Focal mechanisms (projection)
                         ├─ Lines (intersection)
                         └─ Polygons (intersection)
                                  │
                                  ▼
                                Plot
                                  │
                          ┌───────┴────────┐
                          ▼                ▼
                  Export geoprofile   Save style
                          │                │
                          └───────┬────────┘
                                  ▼
                          Import geoprofile

Core Concept

GeoProfiler is built around two geometric elements:

Data behavior

Mental Model (important)

All outputs depend only on:

The plot is a pure result, not stored.

0. Creating Topographic Profiles

Profiles are stored as 3D line layers in a GeoPackage, and are created with the commands under 0 - Create 3D topographic profile (Fig. 2), run in the order they are listed in: storage, trace, elevation source, generation.

This section is only needed to build a topographic profile. A 3D line layer you already have - from an earlier session, or produced outside the plugin - is used as it is: load it into QGIS and carry on from 1. Working Profile Layer.

Define the output storage

Where the generated profile will be written: a GeoPackage, and a 3D line layer inside it. One of:

Mandatory, and to be done before Generate 3D profile: a generated profile with no storage defined has nowhere to be written and is lost. The run still reports the profile as generated; only the "qgSurf" log panel records that nothing was stored.

Define the trace

Define elevation

Choice of the source DEM
Fig. 5. Choice of the source DEM.

Generate the profile

Generate 3D profile samples the DEM along the trace and writes the resulting 3D line(s) to the storage layer.

Profiles settings
Fig. 6. Definition of the profile parameters. In this example 5 parallel profiles will be created with a spacing of 200 units (depending on the CRS, meters, feet or others). The dialog now also carries Grid-sampling spacing within profile, i.e. the spacing at which the DEM is sampled along the trace, proposed as the DEM cell size, which is the finest spacing that still adds information.

Parallel profiles

Example of topographic profile
Fig. 7. Example of topographic profiles created with the parameters defined in the previous figure. Data: TinItaly, Mount Alpi (Southern Italy). The current default plot names both axes with their quantity and unit, which this screenshot predates.

1. Working Profile Layer

Load the 3D line layer into QGIS and select:

1 - Choose 3D topographic profile

This defines the reference geometry for all operations.

The dialog also asks, optionally, for a profile name field of that layer: the value it holds for each chosen line becomes the name of the profile, is written to the export, and is what Section Editor titles the section with. The profile_name field of a layer generated here is proposed already chosen; any other field of any other layer can be picked instead. Left on --optional--, or empty for a given line, the profile is named after the feature id of the line it was read from. A geoprofile reimported from an export keeps the names it was exported with.

Redefining the base 3D profile (new line source, DEM, digitized trace, or project reload) clears any previously defined point/attitude/focal mechanism projections and line/polygon intersections, since they were computed against the profile just discarded. Redefine the geological data stages afterwards.

2. Geological Data Integration

Each stage below (points, attitudes, focal mechanisms, lines, polygons, see Fig. 3) runs its own projection/intersection immediately once its dialog is confirmed - there is no separate "create/apply" step: define a stage, and its result is computed and added to the geoprofile right away, ready to be re-plotted. A progress bar follows the run, which for large datasets advances per block of points over the whole set of profiles.

2.1 Point projections

Inputs:

Depths instead of elevations

When the vertical value is read from the layer (a field, or the point geometry), it can be declared a depth rather than an elevation, which is the usual form for hypocentres:

The values are converted into the elevation the profiles are drawn in; the plot itself keeps working in metres of elevation. The controls do not apply to the DEM option, which already yields an elevation, and are therefore disabled there.

Point projection dialog
Fig. 8. Example of point projections UI. The current dialog offers the three elevation sources (DEM, z field, 3D points), the depth controls described above and the DEM used for depths below topography.
Hypocentres plotted on a profile
Fig. 9. Seismic hypocenters of the 2007 Colfiorito sequence (Central Apennines) plotted in parallel profiles. Worth retaking with the depths read as such and the vertical axis labelled as a depth in km (see Graphical parameters).

2.2 Attitude projections

Inputs:

Output:

Attitude projection dialog
Fig. 10. Geological attitudes projection UI. The current dialog adds the record id/label field and the choice of the elevation source (DEM, z field, 3D points).
Projected attitudes on a profile
Fig. 11. Example of geological attitudes projection along a set of parallel profiles in the eastern sector of Mt. Alpi zone (Basilicata, Southern Italy).

2.3 Focal mechanism projections

Earthquake focal mechanisms are projected like attitudes - the fault plane is an attitude - and drawn as beachballs.

Inputs:

Beachballs are rendered through obspy, an optional dependency. If it is not available in the QGIS Python environment, the command reports so as soon as it is invoked: install it (pip install obspy) and restart QGIS.

Records whose azimuth, dip or rake are missing or non-numeric are skipped and reported in the QGIS log panel, so a few bad rows do not stop the run.

Projected attitudes on a profile
Fig. 12. The focal mechanism projection dialog.

Beachball style

Under Define graphical parameters → Focal mechanism projections:

Projected attitudes on a profile
Fig. 13. The beachball style dialog.
Projected attitudes on a profile
Fig. 14. Focal mechanisms plotted on a profile as beach balls.

2.4 Line intersections

If the layer has a selection, only the selected features are intersected.

Line intersection dialog
Fig. 15. Line intersections UI.
Fault intersections on a profile
Fig. 16. Example of labelled fault intersections, together with seismic hypocenters of the 2007 Colfiorito sequence (Central Apennines).

2.5 Polygon intersections

The colour of each category is then set under Define graphical parameters → Polygon intersections.

The colours start from the layer's own symbology and keep following it: recolour a class in QGIS and the next plot, or the next opening of that dialog, shows the new colour. A class you recolour here instead becomes yours, and is no longer overwritten by the layer. Reload from source layer, in the same dialog, gives up those choices and takes the layer symbology as it stands.

Unlike the line intersections, polygon intersections always use the whole layer: a selection in QGIS does not restrict them.
Polygon intersection dialog
Fig. 17. Geological polygon intersection UI. The current dialog asks for the polygon layer only: the classification field is gone, categories being taken from the layer's symbology.
Polygon intersections on parallel profiles
Fig. 18. Example of geological polygon intersection on a profile in the Timpa San Lorenzo zone (Calabria, Southern Italy).

2.6 Records that cannot be read

Source layers are rarely spotless. Features with a null or empty geometry, and parts with too few points to define a line, are skipped and reported in the QGIS Log Messages panel, under the qgSurf tab, one message per feature: the stage carries on with the remaining ones instead of failing as a whole. A stage fails, with an explicit message, only when nothing usable is left in the layer.

The log panel is the place to look when a layer yields fewer intersections or projections than expected: it names the features that were left out.

3. Graphical Parameters

Controls the appearance of the plot, under 3 - Set graphical parameters → Define graphical parameters:

Polygon intersections on parallel profiles
Fig. 19. The window for the definition of the graphical parameters.

Persistence

Polygon categories must match when reloading saved parameters. A style file written before an option existed loads with that option at its default.

4. Plot

Run:

4 - Plot geoprofile

Exploding a single profile

The stacked plot splits its vertical room between every profile, so with nine of them each panel is a sliver. The Explode chooser on the plot window lists the profiles by the same numbers the stacked plot labels its panels with: pick one and it opens in a window of its own, with the full height to itself. Several exploded profiles can stay open side by side for comparison.

Each exploded window carries its own Graphical parameters button, which restyles and redraws that profile alone. Its parameters start as a copy of the stacked plot's, so the window opens looking like the panel it came from and diverges only where it is changed.

5 and 6. Export and Import (Reproducibility)

Key idea

Data and visualization are decoupled.

Export geoprofile

Use:

5 - Export geoprofile

This saves:

Into a database file: SQLite by default (.sqlite/.db), or GeoPackage (.gpkg) if preferred. Either the whole set of profiles or a chosen subset of them can be exported, under a named result set.

The graphic attributes in force when the export is written are saved with the data: the colour of every geological unit, the colours, widths, line styles and markers of the topography and of the projections, and the elevation range and vertical exaggeration of the axes. A profile exploded and restyled on its own carries its own attributes alongside those of the stacked plot. What is saved is what the plot shows at that moment, not what the source layer symbology says now.

The classification of the source layers is saved too, whole: every class of the polygon layer, in the order of its legend and with the colour it is drawn in, and every category of the intersected lines, in the gp_source_categories table. A single profile crosses only some of the classes of the map it is cut from, and the intersection tables can say nothing of the others: this is what lets the Section editor offer the whole classification of the map on every section, and give a unit the same colour in all of them.

Every profile also carries the coordinates that tie it back to the map: each topographic sample is saved with its real-world x and y, and the vertices of the profile trace — the start one, the end one and every direction change in between — are saved in the gp_profile_vertices table with their distance along the profile, their coordinates in the project CRS and their longitude and latitude (EPSG:4326). A profile exported this way can be hooked back onto its map position by any reader of the database.

Import geoprofile

Use:

6 - Import geoprofile

This allows you to:

The profiles come back looking as they did when they were exported: Use the graphic attributes exported from GeoProfiler, on by default, puts back the unit colours, the styles of the projections and the axis range, so a geoprofile reopened in a fresh QGIS session is the figure it was, and not a plot recoloured at random. Uncheck it to plot with the styles currently set instead. The option is offered only when the chosen database actually carries the attributes: an export written by an earlier version of GeoProfiler does not.

More than one profile can be imported at once, and the layout of the imported profiles decides how they are plotted: one below the other (vertical, the usual stack), one beside the other (horizontal) or on a grid of the chosen number of columns. On a grid every panel is labelled and graduated on its own, profiles of different lengths being plotted side by side.

Why this matters

Current Limitations

Design Philosophy

GeoProfiler is designed to be: