Skip to main content
Fixed broken URL
Source Link
Jeffrey Evans
  • 32k
  • 2
  • 48
  • 97
Correct name of pipeline author. Remove coplanar filters from example pipeline as they are beside the point in this case. Fix JSON formatting to be uniform across examples.
Source Link
{
    "pipeline": [
        "inputfile.laz",
        {
            "type":"filters.smrf",
            "cell": "2.0",
            "threshold": "0.75"
        },
        {
            "type":"filters.range",
            "limits":"Classification[2:2]"
        },
        "out/smurf_classifed.las"
    ]
}

This example a) classifies into ground/not-ground, b) adds "Height Above Ground" attribute, and c) exports only points 2.0 (coordinate system units) above ground points.

{
    "pipeline": [
        "input.laz",
        {
            "type": "filters.assign",
            "assignment": "Classification[:]=0"},
    {"type": "filters.smrf"   },
    {"type": "filters.hag"},   {
    {        "type": "filters.range",smrf"
       "limits": "HeightAboveGround[2:]"},
        {
            "type": "filters.approximatecoplanar",hag"
       "knn": 10},
        {
            "type": "filters.range",
            "limits": "Coplanar[1"HeightAboveGround[2:1]"]"
        },
        {
            "filename":"above-ground.laz"
        }
    ] 
}

Adapted from BruceBrad Chambers, https://lists.osgeo.org/pipermail/pdal/2017-July/001367.html

{
    "pipeline": [
        "inputfile.laz",
    {
      "type":"filters.smrf",
      "cell": "2.0",
      "threshold": "0.75"
    },
    {
      "type":"filters.range",
      "limits":"Classification[2:2]"
    },
    "out/smurf_classifed.las"
    ]
}

This example a) classifies into ground/not-ground, b) adds "Height Above Ground" attribute, and c) exports only above ground points.

{"pipeline": [
    "input.laz",
    {"type": "filters.assign",
       "assignment": "Classification[:]=0"},
    {"type": "filters.smrf"},
    {"type": "filters.hag"},
    {"type": "filters.range",
       "limits": "HeightAboveGround[2:]"},
    {"type": "filters.approximatecoplanar",
       "knn": 10},
    {"type": "filters.range",
       "limits": "Coplanar[1:1]"},
    {"filename":"above-ground.laz"}
]}

Adapted from Bruce Chambers, https://lists.osgeo.org/pipermail/pdal/2017-July/001367.html

{
    "pipeline": [
        "inputfile.laz",
        {
            "type":"filters.smrf",
            "cell": "2.0",
            "threshold": "0.75"
        },
        {
            "type":"filters.range",
            "limits":"Classification[2:2]"
        },
        "out/smurf_classifed.las"
    ]
}

This example a) classifies into ground/not-ground, b) adds "Height Above Ground" attribute, and c) exports only points 2.0 (coordinate system units) above ground.

{
    "pipeline": [
        "input.laz",
        {
            "type": "filters.assign",
            "assignment": "Classification[:]=0"
        },
        {
            "type": "filters.smrf"
        },
        {
            "type": "filters.hag"
        },
        {
            "type": "filters.range",
            "limits": "HeightAboveGround[2:]"
        },
        {
            "filename":"above-ground.laz"
        }
    ] 
}

Adapted from Brad Chambers, https://lists.osgeo.org/pipermail/pdal/2017-July/001367.html

Source Link
matt wilkie
  • 28.3k
  • 35
  • 149
  • 283

This can be done with a filter using either Simple Morphological Filter (SMRF) or Progressive Morphological Filter (PMF) algorithms.

Quick

pdal ground --cell_size=5 --extract input.laz out-bare-earth.laz

Creates a bare earth compressed LAS file with a 5 ground unit cell size using PMF. (docs)

For more explanation see the Identifying ground returns using ProgressiveMorphologicalFilter segmentation tutorial.

More involved, using SMRF

A pipeline example that:

  • applies the SMRF filter, enlarges the cell size option to 2.0 (coordinate system units) and a 0.75 threshold
  • selects only the newly classified ground points (2 is the LAS standard value for ground)
  • writes selection to an uncompressed LAS output file (just change extension to .laz for compressed)

Command: pdal pipeline "classify-ground-smrf.json"

The JSON parameters file:

{
    "pipeline": [
        "inputfile.laz",
    {
      "type":"filters.smrf",
      "cell": "2.0",
      "threshold": "0.75"
    },
    {
      "type":"filters.range",
      "limits":"Classification[2:2]"
    },
    "out/smurf_classifed.las"
    ]
}

Extract above ground only

This example a) classifies into ground/not-ground, b) adds "Height Above Ground" attribute, and c) exports only above ground points.

{"pipeline": [
    "input.laz",
    {"type": "filters.assign",
       "assignment": "Classification[:]=0"},
    {"type": "filters.smrf"},
    {"type": "filters.hag"},
    {"type": "filters.range",
       "limits": "HeightAboveGround[2:]"},
    {"type": "filters.approximatecoplanar",
       "knn": 10},
    {"type": "filters.range",
       "limits": "Coplanar[1:1]"},
    {"filename":"above-ground.laz"}
]}

Adapted from Bruce Chambers, https://lists.osgeo.org/pipermail/pdal/2017-July/001367.html