What it does
Ground classification is the step every terrain product depends on. A DTM, a contour set, a volume, a height-above-ground for trees or buildings — each needs to know which points are the earth and which are standing on it. This tool answers only that question: every point it filters becomes class 2 (ground) or class 1 (not ground), and the rest of the file is written back untouched.
The right settings depend on the site, so they are not guessed up front. The file is read once, and a map of the result appears: brown where the points are ground, grey where they are not. Changing the window, cut, slope or threshold redraws it in a fraction of a second — on a 110 million point survey, 0.2 to 0.3 s — because only the grid is recomputed, not the file. When the map looks right, the file is read once more and every point is labelled with those settings. The map is drawn from a sample of up to two million points, which receive exactly the classes the output gives them.
SMRF works on a grid of the lowest point in each cell, in four steps:
- Minimum surface. The lowest elevation in every cell is taken, and empty cells are filled from their eight nearest neighbours.
- Low outliers. The surface is turned upside down and filtered once, which finds isolated pits — a stray reflection below the ground, a multipath return — so they cannot drag the ground model down.
- Progressive opening. The surface is opened with a window that grows one cell at a time up to the maximum radius. At each step, a cell that drops by more than slope × cell × radius is marked as an object. Terrain can only fall away gradually, however wide the window gets; a roof disappears all at once in the step whose window first spans it. That difference is the whole filter.
- Provisional DEM and threshold. Object and outlier cells are removed and refilled from the ground around them. Each point is then ground if it lies within threshold + scalar × slope of that surface, where the slope term relaxes the test on steep ground to absorb small positional errors.
Verified against PDAL
This is a port of PDAL 2.10's SMRF filter rather than a reimplementation of the paper, and it is checked by running native PDAL on the same file and comparing the classification of every point.
| Cloud | Points | Ground | Points that differ |
|---|---|---|---|
| Airborne LiDAR, Brussels city centre, defaults | 5,850,130 | 28.6% | 0 |
| Same, 0.5 m cell, 30 m window, cut, ground-only, first returns | 5,850,130 | 26.7% | 0 |
| Drone photogrammetry, urban square | 31,002,884 | 27.1% | 0 |
| Drone photogrammetry, residential block | 26,134,167 | 32.6% | 0 |
| Drone photogrammetry, industrial site | 49,716,736 | 66.9% | 0 |
Getting to zero needed more than the algorithm. When an empty cell is filled from its eight nearest neighbours, the cells of a regular grid are very often tied for eighth place, and which of them is chosen depends on the internal layout of the search tree. So the tree PDAL builds is reproduced too, down to its split rule and the order it visits cells in — otherwise a few tenths of a percent of points come out differently.
The parameters
| Parameter | Default | Change it when |
|---|---|---|
| Cell | 1 m | The ground is sampled much more or much less densely than one point per square metre. |
| Window | 18 × cell | Buildings are wider than about twice this. Too small and large roofs are called ground; much larger and real terrain features start being removed with them. |
| Slope | 0.15 | The terrain is steep. Raise it for hillsides and embankments; lower it to cut low objects more aggressively on flat sites. |
| Threshold | 0.5 m | Low vegetation or kerbs should be excluded from ground (lower it), or the cloud is noisy (raise it). |
| Scalar | 1.25 | Steep ground is being split into ground and non-ground stripes. |
| Cut | 0 (off) | Very large buildings stand on strongly sloping terrain, where a wide enough window would also flatten hills. |
Where to look when checking the result
- The largest roofs. A roof the window cannot span is classified as ground in its middle. The map makes this obvious — a brown patch on top of a building — and the fix is a wider window: drag it up until the roof turns grey.
- Stepped buildings that fill the capture. When a survey is cropped tightly around one building, with only a few metres of ground at its edge, and the roof comes down in terraces — a main roof, a lower annex, then the yard — the filter can take the building away one terrace at a time. Each step then looks like a slope rather than a wall, and the whole building survives as a hill however wide the window. A Cut lays a net of low points across the site that the terraces cannot hide behind; around 20 m fixes a single building, and a complex of large halls may need the cut and the window raised together. The effect is not monotone — a little more cut can bring a roof back — so watch the map while you adjust, and check that open ground stays brown: on sites with real terrain a cut removes ground too.
- Bridges and decks. A bridge wide enough to survive the window looks like ground to any morphological filter.
- Low noise. If the cloud has been denoised into class 7, tick Ignore noise points so the removed points stay out of the minimum surface.
- Under canopy. On photogrammetry there is no ground to find there; on LiDAR, sparse ground returns under dense cover may need a slightly larger threshold.
After classification
The output is an ordinary LAS or LAZ with ground in class 2, ready for anything that reads classified point clouds. To turn it into a terrain model, open it in LAS to DEM and build a DTM from the ground class; to look at it in 3D, colour it by class in the viewer.