PDAL - jgoffeney/Cesium4Unreal GitHub Wiki

Back

Description

PDAL is a library and tools for working with point clouds.

Tools

Merge

The merge tool combines several point cloud files into a single file.

Usage

  • pdal merge input0 input1 input2 ... inputN output

Example

pdal merge 0762358w_370539n_buildings.las 0762357w_370450n_buildings.las 0762257w_370539n_buildings.las 0762256w_370451n_buildings.las buildings.laz

Pipeline

The pipeline tool allows you to create a graph of commands in a JSON file.

Usage

  • pdal pipeline commands.json

Examples

Assign Classification Value

Assigns a ground classification value to all points in in the input.

{
	"pipeline": [
		{
    			"type":"readers.las",
    			"filename":"ground.laz"
    		},
    		{
    			"type": "filters.assign",
    			"value": "Classification = 2"
    		},
    		{
			"type":"writers.las",
			"filename":"ground_class.laz"
        	}
	]
}

Clipping To Shapefile

This is the roundabout way of clipping LAS files to a mask supported by PDAL as described here. In the filter.overlay section it looks for a field in the shapefile named CLS and for any point under the shape it writes the shape's value to the points Classification field. In the filters.range section it filters out any points with a _Classification+ value outside of the range.

Without a spatial index I assume this is a brute force operation for each point to each shape.

  • Clipping Forests From LAS
{
    "pipeline": [
    	{
    		"type":"readers.las",
    		"filename":"source.laz"
    	},
    	{
    		"type": "filters.overlay",
            	"datasource": "forest.shp",
            	"dimension":"Classification",
            	"column":"CLS"
    	},
    	{
            "limits": "Classification[5:5]",
            "type": "filters.range"
        },
        {
		"type":"writers.las",
		"filename":"target.laz"
        }
    ]
}

  • Masking Out Buildings and Forests to Leave Ground

This takes unclassified LAS data, applies buildings and forest classifications from the shapefiles and keeps the remaining unclassified points as ground.

{
    "pipeline": [
    	{
    		"type":"readers.las",
    		"filename":"ptcld.laz"
    	},
    	{
    		"type": "filters.overlay",
            	"datasource": "building.shp",
            	"dimension":"Classification",
            	"column":"CLS"
    	},
    	{
    		"type": "filters.overlay",
            	"datasource": "forest.shp",
            	"dimension":"Classification",
            	"column":"CLS"
    	},
    	{
            "type": "filters.range",
            "limits": "Classification[0:0]"
            
        },
        {
		"type":"writers.las",
		"filename":"ground.laz"
        }
    ]
}

Translate

The translate tool is used to convert files.

Reprojection

Translate can be used to reproject data. See LAS Reading and Writing with PDAL for setting the scale when reprojecting LAS data.

Usage
  • pdal translate inputFile outputFile reprojection --filters.reprojection.out_srs="targetEPSG" --writers.las.scale_x=0.0000001 --writers.las.scale_y=0.0000001 --writers.las.offset_x="auto" --writers.las.offset_y="auto"
Example
pdal translate buildings.laz buildings_lla.laz reprojection --filters.reprojection.out_srs="EPSG:4326" --writers.las.scale_x=0.0000001 --writers.las.scale_y=0.0000001 --writers.las.offset_x="auto" --writers.las.offset_y="auto"