AutoTrace Stratigraphic Boundary

Predicts where stratigraphic boundaries crop out from outcrop observations (dip / dip direction) and a DEM, using the structure-contour method, then builds a geological map from your edited lines and the faults, and a 3D geological model with geological sections.

English · 繁體中文 · 简体中文 · 日本語

▶ Video tutorials: English · 繁體中文

Contents

  1. Workflow
  2. How predicted boundary lines are drawn
  3. How the geological map is built
  4. Preparing your data
  5. Step-by-step with the sample project
  6. Parameters
  7. Output fields
  8. 3D geological model and sections
  9. Tips and limitations

1. Workflow

①
Outcrop points
+ DEM + faults
→ ②
Trace predicted boundary lines
(temporary layer)
→ ③
Edit the lines
in QGIS
→ ④
Build geological map
(geology polygons)
→ ⑤
3D model and sections
(GeoPackage, CAD, 3D viewer)

Both tools are in the menu Plugins ▸ AutoTrace Stratigraphic Boundary, on the toolbar, and in the Processing Toolbox (group Geological mapping), so they can be used in batch mode and in models.

2. How predicted boundary lines are drawn

2.1 The structure-contour method

Over a short distance a bedding boundary can be treated as a plane. An outcrop point P0(x0, y0) with dip δ and dip direction α lies on the ground, so its elevation z0 is read from the DEM. The plane through it is

zs(x, y) = z0 − tan δ · [ (x − x0) sin α + (y − y0) cos α ]

Its structure contours (lines of equal elevation on the plane) run parallel to the strike, and their spacing is h / tan δ for a contour interval h. Wherever a structure contour crosses a topographic contour of the same elevation, the boundary crops out. Joining those crossings gives the outcrop trace.

The plugin does this continuously, not just at contour levels: it computes the difference between the ground and the plane on every DEM cell,

F(x, y) = DEM(x, y) − zs(x, y)

and follows the line F = 0 to both sides of the point (GDAL contour generator, linear interpolation between cells).


Fig. 1 – Sample point 11 (O5/O4, 44°/241°). Brown: topographic contours. Blue dashed: structure contours of the bedding plane. Red dots: crossings at equal elevation. Red line: predicted outcrop line (F = 0).

Fig. 2 – Profile along the dip direction through the same point. Dashed: bedding plane; orange: upper unit (ground above the plane); blue: lower unit.

So the line bends up valleys and around ridges as the topography requires (the "rule of Vs"). A gentle dip makes the line follow the contours closely. A vertical bed gives a straight line.

2.2 Joining points of the same boundary (end to end)

Points that have the same upper and lower unit codes and lie in the same fault block belong to the same boundary. Their planes are combined into one smooth surface by inverse-distance-weighted blending of the planes:

z(x, y) = Σ wi zi(x, y) / Σ wi, wi = 1 / dip

where zi is the plane of point i, di the distance to it and p the blending power (default 4). The surface passes exactly through every point and keeps that point's own dip and dip direction there. Between points the attitude changes gradually, so the line can bend around a fold hinge or nose. One F = 0 line then runs through all the points and joins them end to end. Pieces of the same boundary that are still separated (for example by DEM nodata) are joined if their loose ends are closer than Join loose ends … closer than.

The alternative method Each point on its own plane traces every point with its own plane only. It is useful for checking single observations.


Fig. 3 – Predicted lines for the sample (no editing). Colour = upper unit, black = fault F1, dots = outcrop points. Where points are sparse (e.g. O3/O2 in the west), the line can split into branches. Those are the places to edit.

2.3 Faults

The faults and the DEM frame split the map into fault blocks. Points are combined only within a block, and the predicted line is clipped to its block, so it stops at the fault and ends exactly on the fault line. A fault that ends inside the map (does not cut a whole block) still cuts the lines that cross it.

2.4 Which side is the upper unit?

For every line the sign of F is tested just to the left and right of the line. The field upper_side stores L or R: the side, looking along the line from its first to its last vertex, on which the upper unit crops out. Overturned points (overturned = 1) swap the sides. This field lets the geology tool label the polygons without any other information.

If you reverse the direction of a line while editing, swap L/R as well. If you draw a new line, fill in unit_u, unit_d and, if you know it, upper_side.

3. How the geological map is built

  1. Polygonize – boundary lines, faults and the map frame are noded and turned into polygons. A line end that stops within the snapping tolerance of another line is joined to it, so small gaps do not leak.
  2. Label by sides – every boundary segment votes: the polygon on its upper_side gets unit_u, the polygon on the other side gets unit_d (votes are weighted by segment length). Segments lying on a fault are ignored.
  3. Unit sample points (optional, e.g. bedding with unit_code) vote for the polygon that contains them and take priority.
  4. Propagation – lines without upper_side pass a known unit across the line to the other side (U on one side of a U/D line ⇒ D on the other side). Propagation does not cross faults.
  5. Small unassigned slivers are merged into the neighbour with the longest shared edge. Polygons are optionally dissolved per unit.
  6. Attributes unit_name, strat_order, series, thick_m, kind and the symbology are copied from the template layer (e.g. an existing geology layer). Without a template, strat_order is derived from the upper/lower pairs (1 = oldest).

Fig. 4 – Geological map built from completed boundary lines, fault F1 and the bedding points of the sample.

Quality check – field qa: ok, conflict (the boundaries around the polygon disagree, usually a gap or a crossing), propagated (inferred across a line), unassigned. The second output Unclosed boundary ends marks line ends that touch nothing. Close them and run the tool again.

4. Preparing your data

LayerTypeFields (defaults)
Boundary outcrop pointsPointdip (0–90°), dip_dir (0–360°, or strike with the right-hand rule), unit_code_u (upper unit), unit_code_d (lower unit), overturned (0/1, optional)
DEMRaster (GDAL file)Projected CRS in metres. The resolution controls the line detail.
FaultsLineAny fields. They should reach the map frame or another fault to split blocks.
Unit sample points (optional)Pointunit_code
Template (optional)Polygonunit_code, unit_name, strat_order, series, thick_m, kind

Layers may use different CRSs; they are reprojected to the DEM CRS (tracing) or to the boundary-line CRS (geology).

5. Step-by-step with the sample project

  1. Plugins ▸ AutoTrace Stratigraphic Boundary ▸ Download sample project and data… – choose a folder. The project case.qgz (oblique-slip fault displacing a plunging fold, EPSG:3826) with data.gpkg and DEM.tif is saved there and can be opened at once. The sample also contains the result of every step: 地層邊界預判線 (predicted lines), 地層預判界線(修正後) (edited lines), geology_Interpolation (generated geology) and Checking_Point (check point), so each tool can be tried directly.
  2. Trace predicted boundary lines… – the dialog is pre-filled with Stratigraphic_Boundary, DEM and faults. Click Run. The temporary layer Predicted boundary lines is added, coloured by upper unit and labelled “upper/lower”.
  3. Edit – toggle editing on the new layer and use the Vertex tool, Reshape, Split or Add line. Turn on snapping to the faults layer so that line ends sit on the faults. Delete wrong branches and connect lines that should meet. Then save the layer to a GeoPackage (right-click ▸ Make Permanent), because temporary layers are lost when QGIS closes.
  4. Build geological map… – choose the edited lines and the faults. For the sample the extent (DEM), bedding (unit sample points) and geology (template) are pre-filled. Click Run.
  5. Check the qa field and the Unclosed boundary ends layer, fix the lines, and run step 4 again if needed.
  6. Build 3D geological model and sections… – the dialog is pre-filled with the geology, DEM, faults, fold_axes, bedding, Stratigraphic_Boundary, section_line and the visible layers to drape. Choose an output folder and a file-name prefix and click Run. The sections open in a new QGIS window (your project stays open and unchanged) and the 3D model opens in the web browser.

6. Parameters

Trace predicted boundary lines

ParameterMeaning
Azimuth field containsDip direction, or strike (right-hand rule: dip direction = strike + 90°).
MethodJoin points of the same boundary (default) or Each point on its own plane.
Join loose ends … closer thanMaximum gap (map units) between free ends of the same boundary that is closed with a straight segment. 0 = off. Ends on faults or the map frame are never joined.
Blending power (advanced)Higher values keep each point's own plane over a larger distance around the point. Lower values give smoother, more averaged surfaces. 3–6 works well.
Maximum extension (advanced)Limits the lines to this distance from the points (0 = whole fault block).
Keep branches that pass no outcrop point (advanced)Also keep other places where the same surface meets the ground (e.g. the same boundary across a valley).
Minimum line length (advanced)Drops short fragments.

Build geological map

ParameterMeaning
Upper / lower unit code field, upper-unit side fieldDefaults unit_u, unit_d, upper_side (written by the tracing tool).
Map extentFrame of the map. If empty, the extent of the lines is used.
Snapping toleranceLine ends closer than this to another line are joined (map units, default 5).
Merge unassigned slivers smaller than (advanced)Area threshold for merging tiny unlabelled polygons.
Dissolve polygons by unitOne (multi)polygon per unit, like the sample geology layer.

7. Output fields

LayerFieldContent
Predicted boundary linesbnd_idLine number
unit_u / unit_dUpper / lower unit code
upper_sideL / R – side of the upper unit along the line direction
block_idFault block number
n_ptsNumber of outcrop points the line passes through
pt_idsTheir feature ids
methodblend / individual
length_mLength
Geologyunit_code … kindSame schema as the sample geology layer
qaok / conflict / propagated / unassigned
area_m2Area

8. 3D geological model and sections

The tool Build 3D geological model and sections turns the geological map into a 3D model, using the same implicit potential-field method as the web app geomap-workbench.

8.1 Principle


Fig. 5 – 3D model of the sample: plunging anticline (O1 core) offset by fault F1; terrain draped with the geological map.

Fig. 6 – Geological section A–A' of the sample (V.E. ×1), x = distance from the start, y = elevation.

8.2 Parameters

ParameterMeaning
Geological map and its fieldsUnit code, stratigraphic order, name, series, thickness, kind (sed / ign).
Faults: dip / dip direction fieldsFault plane attitude (default dip 60° when empty).
Attitude points 1 and 2Dip, dip direction (or strike), unit code (optional; otherwise the unit under the point), overturned.
Section linesOne section per line (field name, e.g. A-A'). Empty: one section across the strike.
Vertical exaggerationOf the section sheet.
Cell size / model depth0 = automatic (1/40 of the map width; depth 35 % of the width below the lowest ground). Smaller cells give smoother but larger files.
Use the unit thicknesses (advanced)Fixes the spacing of the interfaces to thick_m instead of solving it from the contacts.
Fold axial traces (trend, plunge, type, name)At a fold hinge the bedding contains the fold axis, so points along every axial trace become attitude constraints (trend empty = along the trace, plunge empty = 0). Fold axes are drawn in the 3D viewer, marked on the sections and saved as fold_axes_3d.
Map layers draped on the terrainDefault: the layers visible in QGIS. They are rendered and draped on the terrain of the 3D viewer and the OBJ file, and saved as *_map.png + .pgw.
Output folder, file-name prefix, 3D CAD formatsEverything is written to one folder: prefix.gpkg, prefix_viewer.html, prefix_section_<name>.qgz (one per section), prefix_map.png + .pgw and the ticked CAD formats: DXF (polyface meshes, one layer per unit), OBJ + MTL (colours, textured terrain), STL (one file per unit).

8.3 Outputs

GeoPackage layerContent
units_3dClosed 3D solid of every unit (MultiPolygonZ, triangles) with volume
horizons_3d / faults_3d / terrain_3dInterfaces between units, fault planes, ground surface coloured by unit
fold_axes_3dFold axial traces draped on the terrain
section_fences_3dSections as vertical 3D panels on the section lines (for the QGIS 3D map view)
section_<name>_units / _profile / _faults / _frame / _labelsThe sheet of each section in its own layers; local section coordinates: x = distance from the section start (0), y = elevation × V.E.
section_lines / model_infoSection lines on the map; parameters, interface levels and warnings

Section projects – every section line gets its own layers in the GeoPackage (section_<name>_units / _profile / _faults / _frame / _labels, e.g. section_A_A_units) and its own project prefix_section_<name>.qgz, which can be opened separately. Each section uses its own coordinates: x = distance from the section start (0 at the left edge), y = elevation (× V.E. when it is not 1), so the left end of the ground line lies at the ground elevation of the section start. A project contains only that section (unit polygons with a legend, ground profile, faults, fold marks, frame, ticks and labels) and an A3 print layout ready for PDF export. The first one opens in a separate QGIS window, so the current project is neither closed nor changed.

3D viewer – prefix_viewer.html (three.js, works offline): unit switches, transparency, vertical exaggeration, east / north cuts and the section cut – choose a section and the side to keep; the model is cut along the section line, the section drawing caps the cut and the view turns to it. Add #cut=0:L (or 0:R) to the address to open with a cut, #nopanel for a clean screenshot.


Fig. 7 – Section cut in the 3D viewer: the model is cut along A–A' and the section caps the cut.

9. Tips and limitations

License: GNU GPL v2 or later.