# filters.radialdensity

The Radial Density filter creates a new attribute RadialDensity that contains the density of points in a sphere of given radius.

The density at each point is computed by counting the number of points falling within a sphere of given radius (default is 1.0) and centered at the current point. The number of neighbors (including the query point) is then normalized by the volume of the sphere, defined as

$V = \frac{4}{3} \pi r^3$

The radius $$r$$ can be adjusted by changing the radius option.

Default Embedded Stage

This stage is enabled by default

## Example

[
"input.las",
{
"type":"filters.radialdensity",
"radius":2.0
},
{
"type":"writers.bpf",
"filename":"output.bpf",
"output_dims":"X,Y,Z,RadialDensity"
}
]


## Options

radius

Radius. [Default: 1.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]