# writers.p2g¶

The points to grid writer takes in a stream of point data and writes out gridded summaries of the stream. Each cell in the output grids can give one of the: minimum value, maximum value, average value, average value, inverse distance weighted interpolation (for sparse points), or density. The points to grid writer supports creating multiple output grids simultaneously, so it is possible to generate all grid variants in one pass.

Warning

writers.gdal is a replacement for writers.p2g. It doesn’t require an externally installed library, it supports more GDAL output formats and options, and it supports the ability to write all output to a single GeoTIFF.

Note

A project called lidar2dems by Applied GeoSolutions integrates the P2G writer and other PDAL components into a series of scripts and utilities that make it more convenient to do DEM production with PDAL.

## Example¶

{
"pipeline":[
{
"filename":"inputfile.las"
},
{
"type":"writers.p2g",
"grid_dist_x":"6.0",
"grid_dist_y":"6.0",
"filename":"autzen_grid",
"output_type":"min",
"output_type":"max",
"output_type":"mean",
"output_type":"idw",
"output_type":"den",
"output_format":"asc",
}
]
}


## Options¶

grid_dist_x
Size of grid cell in x dimension [Default: 6]
grid_dist_y
Size of grid cell in y dimension. [Default: 6]