filters.smrf

filters.smrf#

The Simple Morphological Filter (SMRF) classifies ground points based on the approach outlined in [Pingel et al., 2013].

Default Embedded Stage

This stage is enabled by default

Example #1#

The sample pipeline below uses the SMRF filter to segment ground and non-ground returns, using default options, and writing only the ground returns to the output file.

json = """
[
    {
        "bounds": "([-10425171.940, -10423171.940], [5164494.710, 5166494.710])",
        "filename": "https://s3-us-west-2.amazonaws.com/usgs-lidar-public/IA_FullState/ept.json",
        "type": "readers.ept"
    },
    {
        "type":"filters.smrf"
    },
    {
        "type":"filters.range",
        "limits":"Classification[2:2]"
    },
    "output.laz"
]
"""

import pdal
pipeline = pdal.Pipeline(json)
count = pipeline.execute()
print(f"Output contains {count} points")
Output contains 1436362 points

Example #2#

A more complete example, specifying some options. These match the optimized parameters for Sample 1 given in Table 3 of [Pingel et al., 2013].

json = """
[
    {
        "bounds": "([-10425171.940, -10423171.940], [5164494.710, 5166494.710])",
        "filename": "https://s3-us-west-2.amazonaws.com/usgs-lidar-public/IA_FullState/ept.json",
        "type": "readers.ept"
    },
    {
        "type":"filters.smrf",
        "scalar":1.2,
        "slope":0.2,
        "threshold":0.45,
        "window":16.0
    },
    {
        "type":"filters.range",
        "limits":"Classification[2:2]"
    },
    "output.laz"
]
"""

import pdal
pipeline = pdal.Pipeline(json)
count = pipeline.execute()
print(f"Output contains {count} points")
Output contains 1451706 points

Options#

cell

Cell size. [Default: 1.0]

classbits

Selectively ignore points marked as “synthetic”, “keypoint”, or “withheld”. [Default: empty string, use all points]

cut

Cut net size (cut=0 skips the net cutting step). [Default: 0.0]

dir

Optional output directory for debugging intermediate rasters.

ignore

A range of values of a dimension to ignore.

returns

Return types to include in output. Valid values are “first”, “last”, “intermediate” and “only”. [Default: “last, only”]

scalar

Elevation scalar. [Default: 1.25]

slope

Slope (rise over run). [Default: 0.15]

threshold

Elevation threshold. [Default: 0.5]

window

Max window size. [Default: 18.0]

where

An expression that limits points passed to a filter. Points that don’t pass the expression skip the stage but are available to subsequent stages in a pipeline. [Default: no filtering]

where_merge

A strategy for merging points skipped by a ‘where' option when running in standard mode. If true, the skipped points are added to the first point view returned by the skipped filter. If false, skipped points are placed in their own point view. If auto, skipped points are merged into the returned point view provided that only one point view is returned and it has the same point count as it did when the filter was run. [Default: auto]