How the kerb trace works
You click once on a kerb. The tool walks along it in both directions, measuring a fresh cross-section every 25 cm, and hands back a 3D line. This page is about what happens in between — and, just as importantly, about where it stops and admits it does not know.
The shape of it
Six stages run for every click. The first four happen live, walking forward into ground the tool has not seen yet. The last two run afterwards, over the finished line, when the geometry on both sides of every point is known.
One idea underpins all of it. The tool never snaps to a point in the cloud. Points in these clouds sit 2–3 cm apart, and a survey wants better than that. So every position it reports is fitted from surfaces — a few hundred points of road and a few hundred of footway — and the kerb edge is found where those two surfaces are related in a particular way. Fitting many points beats snapping to the nearest one, and that is where the accuracy comes from.
Step 1 The click, and which way the kerb runs
Your click gives an approximate position and nothing else. The tool has to work out the direction the kerb runs before it can measure anything, because every measurement it makes is taken across a slab laid at right angles to that direction.
So it tries sixteen directions through the click, spread over a half turn, and measures a cross-section along each. On a straight kerb this is easy: a slab laid at an angle smears the kerb face across the section and fails to find a step at all, so only directions close to the true one produce a fit. At a corner it is not easy. The kerb is already curving inside the slab, so eight to thirteen of the sixteen directions produce a plausible fit, and simply keeping the best-scoring one is a coin toss. Clicks 10 cm apart used to come back with headings 113° apart, and some of them ran off across the road.
The fix is not a better score, it is a corroboration test: a direction is only believed if the kerb continues along it. The tool steps one 25 cm pace forward and one back along each candidate direction, and re-measures. If the direction is wrong by an angle, the kerb appears displaced to one side ahead and to the other side behind — and by how much tells you exactly how wrong the direction was.
Two more things the probes check, and both exist because of real failures: the kerb ahead and behind must be about the same height as the kerb at the click, and the footway must be on the same hand. That second one is what rejects the kerb on the far side of the street — it is exactly the same height, so height alone cannot tell them apart, but the carriageway lies between them, so crossing it puts the high side on the other hand.
Step 2 Reading one cross-section
This is the measurement everything else is built from, and it is repeated a few hundred times per trace. The tool cuts a slab across the kerb — 0.8 m along the kerb, 2 m across it — and collapses every point in it into a profile: the ground level in each 1 cm-wide strip across the slab.
Each 1 cm strip reports a low percentile of the heights in it, not the average. That is deliberate: the average is dragged upward by points resting on the kerb face and by litter, and the minimum picks up stray points below the surface, which photogrammetric clouds have plenty of.
Then it finds the step. Not by intersecting the road and the footway — they are nearly parallel, so where they cross depends on almost nothing and lands metres away. Not by fitting a line down the kerb face either — the face is only 2–3 cm wide in plan, which is two or three strips. What it does instead is fit a line to the road, fit a line to the footway, and find where the profile between them crosses a set fraction of the way up the step.
The crossing level is set at 65% of the step height, and there is no geometric reason for that number — it is where the surveyors who drew this project's ground truth put their lines, partway down the rounded shoulder of the kerb. It is the single setting accuracy is most sensitive to, and the first thing to re-tune on a new site.
Push the batter slider and you can see the problem with the whole idea. On a kerb leaned back or worn down, the 65% crossing slides inward, so the line records how weathered the kerb is rather than where the arris is. That is precisely the imperfection you wanted a line to see past.
The section template
So there is a second, better reading of the same profile: fit three straight parts — road, face, footway — and construct the two corners they define. The arris is where the face meets the footway; the toe is where it meets the road. This is a well-conditioned intersection precisely where road-meets-footway was not, because the face is near-vertical and the footway near-horizontal, so they meet at close to a right angle.
Measured against a known synthetic kerb, the 65% crossing drifts across 4.8 cm as the batter goes from plumb to heavily raked, while the constructed arris stays within a few millimetres and stops moving with the batter at all. It also still works on faces so raked that the crossing method gives up entirely — try the last third of the batter slider above. The template needs no points near the corner — it works out where the corner would be — which is exactly why it survives weathering.
Step 3 Walking the kerb
With a position and a direction, the march is simple to state: step 25 cm forward along the current heading, cut a new slab, fit it, append the vertex, update the heading, repeat. Then do the whole thing again backwards from the click. It stops when it runs out of kerb, when the line would have to turn implausibly sharply, or after 1200 steps.
The heading comes from the last eight vertices — about 2 m of kerb — because a heading taken from just the last two carries all of the newest vertex's noise. One 3 cm sideways wobble over a 25 cm step is 7°, and the trace then coasts off at that angle. Fitting a direction to 2 m of line was the difference between stopping at 60 m and tracing a full 85 m kerb.
But there is a subtlety that costs centimetres on every bend, and it is worth understanding because it explains where the residual error in this kind of tool lives. A straight line fitted to the last 2 m gives you the direction of the kerb in the middle of that 2 m — a metre behind where the march is actually standing. On a bend the kerb has turned since then, so the tool sets off about 11° wide at a 5 m radius, the slab lands oblique, the kerb face smears, and the vertex lands inside the true line.
The fix is not a different measurement, it is the same measurement read at the right place: a gentle curve is fitted to that same trailing window and its direction taken at the newest vertex. On synthetic kerbs of known radius this cuts the inward lean from 6.2 to 1.7 cm at a 5 m radius, and from 10.3 to 3.2 cm at 3 m.
Step 4 Gaps
About a third of the kerb in this project's sample streets is not measurable: driveways, dropped crossings, parked cars, occlusion shadows. Gaps are the normal case, not the exception, so the march has to be able to cross one — and that is the most dangerous thing it does, because a gap is exactly where there is no evidence.
Gaps also sit disproportionately on corners — dropped kerbs are at junctions and crossings — so simply continuing straight cuts the corner. But forcing the recent curve through the gap is worse: a small turn rate integrated over 12 m walks clean off the kerb. What works is a race. The tool launches several continuations — straight, hold the current curve, ease it off — and keeps whichever finds kerb again first.
A re-acquisition is only accepted if it is continuous with the kerb that was lost: about the same height, and the footway on the same hand. The height tolerance cannot be tight, because across a dropped kerb the kerb genuinely resumes at a different height. And the tool will not steer on a curve it does not have evidence for — if the trace leading into the gap was itself mostly guesswork, only the straight continuation is offered.
If nothing re-finds the kerb within 18 m, the trace ends at its last confident vertex and emits nothing at all for the gap. It does not trail off into open ground. A short line is a much better deliverable than a long one that is wrong somewhere in the middle without saying where.
Step 5 Going back over it
Everything up to here is causal: each decision used only what was behind it. Once the march has finished, the tool knows what is on both sides of every vertex, and that is genuinely new information — not a cosmetic pass. Five things happen, in order.
Re-measuring, with the bend known
Every vertex is re-fitted with a heading taken from a window centred on it rather than trailing behind it, with the curvature measured from both sides, and with the strips laid along the curve rather than a chord. This is where the heading lag described above is finally removed rather than merely reduced.
Filling in the gaps from both ends
During the march, a gap could only be crossed by extrapolating from the near lip. Afterwards both lips are known, so a bridge is replaced by a smooth curve fitted between the two, and then re-measured along its length. Where the kerb is really there after all, those vertices are promoted from guessed to measured: on one of the sample kerbs this took coverage from 76% to 94%.
Recovering kerb the march refused
The march insists on a step at least 6 cm high completing within 12 cm across. That is right while marching — a 2 cm rise with only a trailing heading locks onto pavement noise — but wrong afterwards, when the position, direction and curvature are known from both sides of the gap. So inside bridged runs, and working inwards from each confident lip so every accepted vertex is continuous with a measurement, the tool re-measures with relaxed rules.
Taking the wobble out — without cutting corners
Each cross-section is fitted independently, so each vertex carries 1–3 cm of its own sideways noise at 25 cm spacing. A kerb is a manufactured product laid to straights and circular arcs; it physically cannot wobble at a 25 cm wavelength. So that wobble is known to be measurement noise, and removing it is a measurement, not a tidy-up.
The tool will not use an ordinary smoother, because an ordinary smoother cuts real corners, and real corners are the whole point. Instead a vertex is nudged toward the arc through its neighbours only when its error is uncorroborated — when it sits off to one side and both of its neighbours sit off to the other.
Setting the line down on the ground
A bridged vertex has its height interpolated straight across the gap. But the commonest reason for a gap in the first place is a vehicle crossing — full height, ramp down, ramp back up — and a straight line across a V is a line through the air. That error is systematic, and it is worst exactly where gaps are likeliest.
Three rules keep this safe. It may only ever move a vertex down — "there are no points above you" has one explanation, while "there are points above you" has many innocent ones, starting with a parked car. It never touches a measured vertex, because correcting a measurement against a cruder estimate of the same thing is inventing geometry. And the estimate is calibrated per trace against that trace's own measured vertices, so it needs no per-site constant. Across the sample data this took the count of bridged vertices floating more than 5 cm above the ground from 207 to 0.
Checking the grades
Finally, the tool checks that the line behaves like a kerb vertically. A kerb top follows the road's longitudinal grade — under 8% almost always — so a vertex that implies a steep slope or a sudden break to its neighbours is either repaired, if a robust line through its neighbours agrees, or demoted: its position is left exactly where it is, but it stops claiming to be a measurement and exports as bridged instead. Demotion is the honest outcome, and the tool's own regression tests treat it as a pass, not a failure.
Step 6 The design line
An 80 m kerb comes out of step 5 as roughly 320 independently measured vertices, each carrying its own millimetres of noise. That is the right answer to "where is this kerb". It is the wrong answer to "what was this kerb laid to" — and for setting-out, checking as-builts or handing geometry to a designer, the second question is usually the one being asked.
So a last stage fits an alignment to the finished line: straights and circular arcs in plan, grades with vertical curves in elevation, and one batter and upstand shared along each run. Eighty metres of kerb becomes about twenty numbers. The wobble has nowhere left to live.
Two things keep it honest. Only measured vertices vote — the alignment may span a gap, but nothing the march guessed is allowed to shape it. And it refuses: too few confident vertices, too poor a fit, or a gap longer than 6 m, and it emits nothing for that run and says why. Where a kerb really is settled, damaged or hand-laid, the alignment does not straighten it out silently — those stations are flagged on their own layer.
The measured line is never discarded. The design is an additional line, drawn over it, on its own layers, behind its own checkbox.
Reading the output
The colours on screen and the layers in the exported DXF carry the same distinction, and it is the one that matters: which metres were measured and which were guessed.
| On screen | Means | DXF layer |
|---|---|---|
| Yellow | Measured. A cross-section was fitted here. | KERB |
| Orange | Bridged. Interpolated across a gap, or demoted by the grade check. | KERB_BRIDGED |
| Pale blue | Measured against a genuinely low upstand — a dropped kerb. | KERB_LOWERED |
| Green | The refined line, drawn over the raw march. | — |
| Magenta | The design arris. | KERB_TOP_DESIGN |
| Amber | The design toe, derived from the arris through the section. | KERB_TOE_DESIGN |
| — | Stations where the measured kerb departs systematically from the design. | KERB_DESIGN_FLAGGED |
| Cyan | Ground truth overlay, where a labelled dataset is loaded. | — |
The fitted and bridged layers share their transition vertex, so they meet rather than leaving a hole at every gap edge. Coordinates are written unshifted in the cloud's own system, with the EPSG code in a comment, because the DXF format has nowhere else to record it.
What it will not do
Every threshold in the tool is site-dependent, which is why they are all exposed in the
parameters panel rather than buried. Setting any post-processing threshold to 0
turns its stage off, so you can see exactly what each one contributed.
- It will not trace through a corner that begins inside a gap. Bridging can only continue a curve the trace was already following. Where the bend starts in the gap there is nothing to continue, and anticipating one would need evidence the trace does not have. This is a known failure on one of the sample kerbs and no setting fixes it.
- It will not invent geometry to look complete. A failed bridge emits nothing. A design fit that cannot be justified emits nothing and says why. A vertex it cannot stand behind is demoted rather than moved.
- It works on shape alone. These clouds carry no usable intensity or return structure, and their classification is only ground / not-ground — which puts the road and the footway in the same class. Colour is for display. Everything above is geometry.
- It measures where the surveyor drew, not where the kerb is. The 65% crossing was tuned against hand-drawn ground truth on this project's sites. On a new site, re-tune that first.
kerbtracer is a proof of concept. The numbers quoted on this page come from its own regression harness, which traces the labelled sample clouds from fixed seeds and fails the build on any regression.