Skip to content
LidarKit

How to remove vegetation from a LiDAR point cloud

Two steps, and the first one is the only one that is hard.

Removing vegetation from a point cloud is always the same two steps:

  1. Classify the points, so vegetation is labelled.
  2. Filter to keep the classes you want.

There is no third way. Nothing in a bare coordinate says "leaf", so a filter can only act on a label that already exists. If your file has no classification, the question "how do I remove vegetation?" is really the question"how do I classify it?"— and that is where the work is. The filtering itself is trivial.

Step 1: Classification

Check first whether the file is already classified, since a great deal of survey data arrives that way. Open it in thepoint cloud viewer, colour by classification, and look at theclass histogram: if classes 3, 4 and 5 hold a plausible share of the points, the work is done. If everything sits in class 0 or class 1, it is not classified, whatever the file name suggests.

If it needs classifying,run the classifier in your browser. It labels ground as 2, vegetation as 3, 4 and 5 by height above ground, and buildings as 6, without uploading anything. It was built for photogrammetric clouds with no return information and uses RGB colour where present.

Check the classification before filtering. This ordering is the whole point: filtering is destructive, and a mistake made now is only discoverable later, in a product where the evidence has already been deleted.How classification workscovers the checking routine; the short version is to view the cloud from a low angle over the hardest features rather than from directly above.

Step 2: Filtering

What to keep depends on what you are doing. The recipes are short:

GoalKeepNotes
Bare earth for a terrain modelClass 2The input to a DTM. Drops buildings too.
Ground and buildings, no plantsClasses 2 and 6The usual "cleaned site" deliverable.
Remove trees, keep undergrowthClasses 2, 3, 6Drops medium and high vegetation only.
Isolate the vegetation itselfClasses 3, 4, 5For canopy analysis — the inverse filter.
Just the treesClass 5High vegetation only.
Everything real, no noiseEverything except 7 and 18Worth doing before almost any other operation.

LAS classification codeshas the complete table, including which codes changed between LAS versions.

Keep what you want, do not remove what you don't

This is the single most useful habit in this article, and the cause of the most common complaint.

Expressing a filter as "remove classes 3, 4 and 5" seems equivalent to "keep classes 2 and 6". It is not. A classifier leaves points it could not identify in class 1, unclassified — and in a real cloud that can be a substantial share: vehicles, fences, poles, machinery, awkward roof furniture, and any vegetation the classifier did not recognise as such. Remove 3, 4 and 5, and all of that stays. Keep 2 and 6, and it does not.

So when someone says "I filtered out the vegetation and there is still vegetation", the answer is nearly always that the remaining points are in class 1. Filter by inclusion.

Flags, not just classes

Two flags sit alongside the class and are easy to overlook:

  • Withheld — the producer marked this point as unusable. It should be excluded regardless of its class.
  • Overlap — the point is in the overlap between flight lines. Valid, but the least accurate points in the file, and often excluded from derived products.

A filter that looks only at the class number silently keeps withheld points. TheLAS inspector shows whether a file uses these flags at all.

Deleting versus flagging

Removal does not have to mean deletion, and usually should not.

ApproachResultWhen
Set the withheld flagPoints stay in the file; most software honours the flag and skips themThe reversible default. Keeps one authoritative file.
Export a filtered copyA second, smaller file; the classified original is untouchedWhen a downstream tool ignores flags, or the deliverable must be small.
Delete in placeThe points are goneRarely worth it. Irreversible, and the space saved is better bought with LAZ compression.

The reason to prefer the first two is that classification is a judgement which may turn out to be wrong. Keeping the full classified cloud and filtering on the way out means a misclassification is a setting to change rather than a survey to repeat.

What removal actually leaves behind

Worth picturing before doing it: filtering to ground does not produce a smooth bare surface. It produces the ground points that were measured,and holes wherever vegetation was.

Under a dense canopy, few pulses reached the ground, so what remains is sparse — sometimes a scatter of points where there had been thousands. That is honest: it reflects what was actually observed. But it means the cloud gets thinner exactly where you most wanted detail, and any surface built across those gaps is interpolated rather than measured.

A related and unavoidable limitation: low vegetation often cannot be removed at all. Grass and dense scrub return echoes that merge with the ground return, so the two are not separable in the data. Those points get classified as ground and stay, leaving the surface a little high and a little rough. No filter fixes this, because the distinction was never recorded.

Checking the result

  1. Open the filtered file alongside the original.
  2. Look from a low angle. Remnant canopy and holes in the ground are both obvious in profile and both invisible from above.
  3. Compare point counts. Losing 60% of a wooded site is expected; losing 60% of an open field means ground was thrown away.
  4. Check theclass histogram of the output — it should contain only the classes you kept.
  5. Look for isolated survivors above the ground. These are usually class 1 points, and they mean the filter was expressed as an exclusion.

Doing this here

Step 1 — the step that decides everything — and the checking around it both run in your browser, on your own machine:

The classified LAS or LAZ you download is the thing the filter acts on. Because the labels are written as standard ASPRS class codes into the point records themselves, keeping classes 2 and 6 — or whichever combination the table above calls for — is a selection your processing software applies to that file, and the labels travel with it wherever it goes next. For the bare-earth case the filter is built in here: LAS to DEM keeps class 2 and drops noise and withheld points when it builds a DTM.

Frequently asked questions

How do I remove vegetation from a point cloud?
Classify the points, then keep the classes you want. There is no way to filter vegetation without first identifying it — removal is a filtering operation on labels that already exist, so if the file has no classification the real task is classifying it. Typically you keep class 2 for bare ground, or classes 2 and 6 for ground plus buildings.
Which LAS classes are vegetation?
Classes 3, 4 and 5 — low, medium and high vegetation. The thresholds between them are conventions chosen by whoever processed the data rather than anything fixed by the standard, so the boundary between low and medium vegetation can differ between two files that both look correct.
Why is there still vegetation after I filtered it out?
Almost always because the remaining points are in class 1, unclassified, rather than in a vegetation class. Classifiers leave points they cannot identify confidently as unclassified, so a filter that removes classes 3, 4 and 5 leaves those behind. Filter by keeping the classes you want rather than by removing the ones you do not.
Can I remove vegetation without deleting points?
Yes, and it is usually better. The withheld flag marks a point as excluded without removing it, and most software honours it, so the decision stays reversible and the file stays complete. Alternatively keep the classified file intact and export a filtered copy for the specific task.
Why does the ground still look bumpy after removing vegetation?
Because low vegetation returns often cannot be separated from the ground at all. Dense scrub and long grass produce echoes that merge with the ground return, so those points are genuinely ambiguous and tend to be classified as ground, leaving the surface slightly high and rough. This is a known systematic bias rather than a filtering mistake.
How do I check that the right points were removed?
View the cloud from a low angle, not from above. Remnant canopy and holes in the ground are both obvious in profile and both invisible in plan view. Compare point counts before and after as well: losing most of a wooded site is expected, while losing most of an open field means ground was thrown away.