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


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.
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.

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.
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.
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.
| contact | Type | Where the younger unit is | Examples |
|---|---|---|---|
| C (empty, 0) | Conformable (bedding) | Above the bedding plane | Bedding within one sequence |
| U (1) | Overlap unconformity | Above the unconformity, often on high ground, can cover large areas | Terrace cover on tilted strata, angular unconformity |
| I (2) | Inset unconformity (cut-and-fill) | Below the reference surface, filling a valley, on the lower ground | Alluvium, low terrace deposits |
unit_d from the points on it or from the bedding line that meets it.upper_side is the opposite of a
bedding contact. This is correct; do not change it.

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.
| Feature | Inset unconformity | Overlap unconformity |
|---|---|---|
| Younger unit | Beside and below the older rocks, filling a hollow | On top of the older rocks |
| Topography of the younger unit | Lower (valley floor, low terrace) | Higher (plateau, hilltop) |
| Shape of the contact | Concave valley floor with steep valley walls | Broad, gently inclined |
| Extent | Confined to valleys, follows the river | Can cover large areas |
| Thickness | Limited by the valley depth, thinning to the edges | More 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.
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.unit_code) vote for the polygon that
contains them and take priority.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.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).
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.
| Layer | Type | Fields (defaults) |
|---|---|---|
| Boundary outcrop points | Point | dip (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) |
| DEM | Raster (GDAL file) | Projected CRS in metres. The resolution controls the line detail. |
| Faults | Line | Any fields. They should reach the map frame or another fault to split blocks. |
| Unit sample points (optional) | Point | unit_code |
| Template (optional) | Polygon | unit_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).
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.
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.apply = 1 to use the suggestion (sug_* fields), 2 to delete the point, 0 to leave it.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.
| Check | Severity | Meaning | Suggestion |
|---|---|---|---|
| A1 | error | Upper or lower unit missing | — |
| A2 | error | Unit code not in the stratigraphic table | the closest code giving a known contact |
| A3 | error | Upper and lower unit the same | — |
| A4 | error | Upper unit older than the lower one | swap |
| A5 | warning | Conformable contact with units missing between | — (fault or pinch-out?) |
| B1 | warning | Contact C between two series | U, or correct the table |
| B2 | warning | Contact U inside one series | C, or correct the table |
| B3 | warning | Upper unit a valley fill (kind fill) but contact not I | I, or correct the table |
| B4 | error | Contact type not understood | C |
| C1 | error | Conformable point without a valid attitude | — |
| D1 | warning | Attitude differs from nearby points of the same contact | their median attitude |
| D2 | warning | Younger contacts nearby below the bedding plane, older ones above | dip direction + 180° (if that explains them) |
| D3 | warning | Height predicted by the neighbours' bedding planes misses the point (three-point problem) | — (check position, attitude, units) |
| D4 | warning | Attitude differs from the bedding measured nearby (bedding layer needed) | their median attitude |
| E1 | warning | Unconformity point off the surface of its neighbours of the same contact | — |
| F1 | info | Duplicate or too close points | apply = 2 deletes one |
| G1 | warning | Table 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.
qa field and the Unclosed boundary ends layer, fix the lines, and run step 4 again if needed.contact field. Trace with Contact type field = contact and
Fit checked, build the map, and compare it with the original geology layer.| Parameter | Meaning |
|---|---|
| Contact type field | C 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 points | Unconformity points with no dip (empty or 0) get dip and dip direction fitted to the elevations of neighbouring points (on by default). |
| Azimuth field contains | Dip direction, or strike (right-hand rule: dip direction = strike + 90°). |
| Method | Join points of the same boundary (default) or Each point on its own plane. |
| Join loose ends … closer than | Maximum 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. |
| Parameter | Meaning |
|---|---|
| Upper / lower unit code field, upper-unit side field | Defaults unit_u, unit_d, upper_side (written by the tracing tool). |
| Map extent | Frame of the map. If empty, the extent of the lines is used. |
| Snapping tolerance | Line 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 unit | One (multi)polygon per unit, like the sample geology layer. |
| Layer | Field | Content |
|---|---|---|
| Predicted boundary lines | bnd_id | Line number |
| unit_u / unit_d | Upper / lower unit code | |
| upper_side | L / R – side of the upper unit along the line direction | |
| block_id | Fault block number | |
| n_pts | Number of outcrop points the line passes through | |
| pt_ids | Their feature ids | |
| method | blend / individual | |
| length_m | Length | |
| contact | Contact type C / U / I | |
| Geology | unit_code … kind | Same schema as the sample geology layer; kind = fill for the younger unit of an inset unconformity; series + 1 above an overlap unconformity |
| qa | ok / conflict / propagated / unassigned | |
| area_m2 | Area |
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.
series; a higher number lies above an unconformity) and ordered by
strat_order (1 = oldest).kind = ign are extruded vertically from the map.volume_m3).

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.
| Parameter | Meaning |
|---|---|
| Geological map and its fields | Unit code, stratigraphic order, name, series, thickness, kind (sed / ign). |
| Faults: dip / dip direction fields | Fault plane attitude (default dip 60° when empty). |
| Attitude points 1 and 2 | Dip, dip direction (or strike), unit code (optional; otherwise the unit under the point), overturned. |
| Section lines | One section per line (field name, e.g. A-A'). Empty: one section across the strike. |
| Vertical exaggeration | Of the section sheet. |
| Cell size / model depth | 0 = 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 terrain | Default: 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 formats | Everything 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). |
| GeoPackage layer | Content |
|---|---|
| units_3d | Closed 3D solid of every unit (MultiPolygonZ, triangles) with volume |
| horizons_3d / faults_3d / terrain_3d | Interfaces between units, fault planes, ground surface coloured by unit |
| fold_axes_3d | Fold axial traces draped on the terrain |
| section_fences_3d | Sections as vertical 3D panels on the section lines (for the QGIS 3D map view) |
| section_<name>_units / _profile / _faults / _frame / _labels | The 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_info | Section 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.

series field of the geological map yourself (larger numbers above an unconformity). Fix the point data when Build geological map warns about lines with the same upper and lower unit, unit codes that are in no polygon (typing errors) or units that are both U and I. Where the map shows a unit of an older series, the model puts no younger series, so the sections agree with the map at the ground.thick_m is optional: when it is empty, the minimum thickness of a unit is estimated from its outcrop width on the map and the attitudes (written to the log and to thickness_estimated_m in model_info), and used only for units whose top or base does not crop out. Small outcrops or units cut by faults can give poor estimates; thicknesses from the explanatory notes of the geological map can be entered instead.License: GNU GPL v2 or later.