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: step by step on sample c22 (1.5) English · 繁體中文; introduction (1.4) 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.

2.5 Contact types and unconformities

The point layer can have a field contact that tells what kind of contact each boundary point is. Always enter the true younger unit as unit_code_u and the older one as unit_code_d; do not swap them to make a line come out right.

contactTypeWhere the younger unit isExamples
C (empty, 0)Conformable (bedding)Above the bedding planeBedding within one sequence
U (1)Overlap unconformityAbove the unconformity, often on high ground, can cover large areasTerrace cover on tilted strata, angular unconformity
I (2)Inset unconformity (cut-and-fill)Below the reference surface, filling a valley, on the lower groundAlluvium, low terrace deposits

Figure 8 – Unconformity samples c21 and c22 (from geomap-workbench; c21, c22 in the sample download). Blue points: conformable (C), red: overlap unconformity (U), orange: inset unconformity (I). (a) c21: Z1–Z3 cap the hills as outliers on an angular unconformity over the tilted A1–A5. (b) Without contact types (as in 1.4): 79 % agreement with the original map; (c) with contact types and fitted dips: 99 %. (d) c22: Y1–Y2 on M1–M5, folded and cut by fault F1, with alluvium Qa added in the valley (inset unconformity, not in the original case). (e) 53 % (Qa 0 %); (f) 99 % (Qa 96 %). In c22 there is no point north of the anticline nose, so the M4 / M3 lines do not close there and need editing.

Figure 9 – Section A–A′ of the 3D model built from the predicted c21 map: the Z series lies on the tilted A series across an angular unconformity, where the A bedding is cut off.

2.6 Characteristics of an inset unconformity

In an inset (cut-and-fill) unconformity a river first cuts down into older rocks and makes a valley, then younger sediment fills the valley. The younger unit is set into the older rocks instead of lying on top of them.

FeatureInset unconformityOverlap unconformity
Younger unitBeside and below the older rocks, filling a hollowOn top of the older rocks
Topography of the younger unitLower (valley floor, low terrace)Higher (plateau, hilltop)
Shape of the contactConcave valley floor with steep valley wallsBroad, gently inclined
ExtentConfined to valleys, follows the riverCan cover large areas
ThicknessLimited by the valley depth, thinning to the edgesMore uniform

The plugin therefore intersects the topography with the surface through the contact elevation (falling downstream after fitting) and takes the ground below the surface as the younger unit. The geological map gives such a unit kind = fill; in the 3D model it exists only inside its map polygons, from the ground down to a given depth (thick_m, 20 m if empty, 45° walls), instead of spreading as a horizontal layer under the whole area.

If your data have upper and lower units swapped to make the lines come out right, enter the true younger and older units again and set contact = I. Overlap and inset surfaces are rarely horizontal (terraces fall downstream, later tilting), so place several points along each contact to let the fit find the slope.

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), contact contact type (C / U / I, 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).

4.1 Checking the boundary points (before tracing)

Field or interpreted boundary points often carry typos in unit codes, reversed upper and lower units, contact types that disagree with the stratigraphic table or mistyped attitudes, which bend the structure contours the wrong way. Run Check stratigraphic boundary points before tracing: it lists the issues and suggestions and changes nothing.

  1. Run Check stratigraphic boundary points with the points and the DEM, optionally a stratigraphic table (a geology map or any layer with unit_code, strat_order, series, kind), faults, fold axial traces and bedding attitudes. Points are compared only within one fault block, attitudes only on one fold limb.
  2. Review the output layer (red = error, orange = warning, blue = info; labelled with the check code) and set apply = 1 to use the suggestion (sug_* fields), 2 to delete the point, 0 to leave it.
  3. Run Apply accepted check suggestions: it writes a corrected copy of the points (field qc_fix lists the checks applied); trace with the copy. The original layer is not changed.

The tracing tool also runs a quick check (without a table) and warns in the log about doubtful points.

CheckSeverityMeaningSuggestion
A1errorUpper or lower unit missing—
A2errorUnit code not in the stratigraphic tablethe closest code giving a known contact
A3errorUpper and lower unit the same—
A4errorUpper unit older than the lower oneswap
A5warningConformable contact with units missing between— (fault or pinch-out?)
B1warningContact C between two seriesU, or correct the table
B2warningContact U inside one seriesC, or correct the table
B3warningUpper unit a valley fill (kind fill) but contact not II, or correct the table
B4errorContact type not understoodC
C1errorConformable point without a valid attitude—
D1warningAttitude differs from nearby points of the same contacttheir median attitude
D2warningYounger contacts nearby below the bedding plane, older ones abovedip direction + 180° (if that explains them)
D3warningHeight predicted by the neighbours' bedding planes misses the point (three-point problem)— (check position, attitude, units)
D4warningAttitude differs from the bedding measured nearby (bedding layer needed)their median attitude
E1warningUnconformity point off the surface of its neighbours of the same contact—
F1infoDuplicate or too close pointsapply = 2 deletes one
G1warningTable unit used by no point (code typo?)—

For issues where the points disagree with the table (B1, B3) the table may be the wrong one: correct whichever is wrong.

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.
  7. Unconformity samples: the downloaded folder also holds c21/c21.qgz (angular unconformity and outliers) and c22/c22.qgz (folds and a fault below an unconformity), from geomap-workbench (Figure 8). Their point layer Stratigraphic_Boundary has a contact field. Trace with Contact type field = contact and Fit checked, build the map, and compare it with the original geology layer.

6. Parameters

Trace predicted boundary lines

ParameterMeaning
Contact type fieldC conformable / U overlap unconformity / I inset unconformity (0 / 1 / 2 and words in English, Chinese or Japanese are also accepted). Empty: all conformable, as in 1.4.
Fit the attitude of unconformity pointsUnconformity points with no dip (empty or 0) get dip and dip direction fitted to the elevations of neighbouring points (on by default).
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
contactContact type C / U / I
Geologyunit_code … kindSame schema as the sample geology layer; kind = fill for the younger unit of an inset unconformity; series + 1 above an overlap unconformity
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.

Unconformities: a change of series in the geological map is an unconformity; a younger series lies above its base surface. Units with kind = fill (valley fills of inset unconformities) are modelled from the ground down to a given depth (thick_m, default 20 m). In attitude layers with a contact field, U / I points are not used as bedding attitudes.

Unknown contacts are not drawn: when no data shows two adjacent units of a series in contact (no map contact off the faults, and no boundary line, boundary point or borehole with that pair), the units below that contact are drawn only where they connect to their own outcrop at the ground of the section without crossing a fault that offsets the layers; elsewhere (beneath the younger units, beneath valley fills, across faults) they and the contact are left blank. The blank area is bounded by bedding and fault surfaces, never by vertical cuts. The log lists these contacts. The 3D solids are not affected.

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, on by default)The interfaces are spaced by thick_m (thicknesses estimated from the outcrop widths where it is empty), the sections are drawn with these thicknesses and, if the oldest unit has thick_m, nothing is drawn below its base. The model then also keeps the units at constant thickness where there are no attitudes (in the direction of the nearest attitudes), and where the units at the ground clearly disagree with the map, points are added and the field solved again, so units cut by a fault at the ground also appear on both sides of it in the sections. When the map is built again, a previous map with thick_m entered can be the template: its thicknesses and unit names carry over (strat_order, series and kind are still derived from the lines).
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). The type is read from the type, name or note field (anticline / syncline, 背斜 / 向斜); when it is known the limbs are constrained too: beds dip away from an anticline and towards a syncline, with the dip measured on that limb; a limb without attitudes is not constrained. Without a name field, Name / 名稱 is used. Fold axes are drawn in the 3D viewer, named on the sections (fault names too) and saved as fold_axes_3d.
Faults (rules of Bennison, Simpson and Lisle)The downthrow side is read from the map (the side with the younger units beside the fault); the type from the fault record (reverse / thrust / normal), normal when not stated, as in the books. Missing dips: 80° normal, 45° reverse (advanced); missing dip directions: a normal fault dips towards the downthrow side, a reverse fault towards the upthrow side. A solved offset opposite to the map (hanging wall down = normal, up = reverse) is not used. A fault that only displaces the older strata does not offset the younger series. In sections a fault is drawn only through the units it displaces: it stops at an unconformable cover it does not offset, and valley fills / terraces are crossed only where the map shows the fault cutting them.
Borehole contacts (optional)One point per contact: depth below the collar (or elevation), upper and lower unit; used as interface constraints (three-point problems).
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.