Taking slices from LiDAR data

maxresdefault

Welp, my BASH skills could use some honing, but I’m just working on quick-and-dirty stuff for this series. PDAL as a utility is pretty interesting, so we’ll focus our learnings on PDAL. (Prior posts start here). I may have a build tutorial written for getting through the critical (as contrasted with minimal) parts of a PDAL build. I’m getting tired of running everything through docker. Besides, I think running through docker is causing me stability problems when I try to run on 40 cores or so… .

If you recall, PDAL is Point Data Abstraction Library. For those who know GDAL, this is the equivalent of GDAL. Much like GDAL simplifies and unifies access to raster data, PDAL is meant to allow people to write software that uses point clouds without having to bother too much with understanding the underlying structure of the data.

Once we have heights calculated for everything, now it’s time to slice up the data according to height above ground. I really wanted to do this in PDAL, but haven’t yet figured out how. I tried using a pcl filter. The syntax is simple enough:

pdal pcl -i /path/to/input/las -p /path/to/pcl/block/json -o /path/to/output/las

And so I create a filter that will filter based on elevation:

{
    "pipeline":
    {
        "name": "PassThroughExample",
        "filters":
        [
            {
                "name": "PassThrough",
                "setFilterFieldName": "z",
                "setFilterLimits":
                {
                    "min": 2000,
                    "max": 2400
                }
            }
        ]
    }
}

And then I use my filter with the pdal pcl command:

#!/bin/bash

pathname="${1%/*}"
name=`basename $1 .bpf`

docker run -v $pathname:/data pdal/master pdal pcl -i //data/"$name".bpf -p //data/elev.filter.json -o //data/"$name"_5.0.bpf;

Sadly however, if I try to adapt for height, I get no points out:

{
    "pipeline":
    {
        "name": "PassThroughExample",
        "filters":
        [
            {
                "name": "PassThrough",
                "setFilterFieldName": "Height",
                "setFilterLimits":
                {
                    "min": 0.5,
                    "max": 5
                }
            }
        ]
    }
}

More investigating to do… .