readers.gdal

The GDAL reader reads GDAL readable raster data sources as point clouds.

Each pixel is given an X and Y coordinate (and corresponding PDAL dimensions) that are center pixel, and each band is represented by “band-1”, “band-2”, or “band-n”. Using the ‘header’ option allows naming the band data to standard PDAL dimensions.

Default Embedded Stage

This stage is enabled by default

Basic Example

Simply writing every pixel of a JPEG to a text file is not very useful.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "pipeline":[
    {
      "type":"readers.gdal",
      "filename":"./pdal/test/data/autzen/autzen.jpg"
    },
    {
      "type":"writers.text",
      "filename":"outputfile.txt"
    }
  ]
}

LAS Example

The following example assigns the bands from a JPG to the RGB values of an ASPRS LAS file using writers.las.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
  "pipeline":[
    {
      "type":"readers.gdal",
      "filename":"./pdal/test/data/autzen/autzen.jpg",
      "header", "Red, Green, Blue"

    },
    {
      "type":"writers.text",
      "filename":"outputfile.txt"
    }
  ]
}

Options

filename
GDALOpen ‘able raster file to read [Required]
count
Maximum number of points to read. [Default: unlimited]
spatialreference
Spatial reference to apply to the data. Overrides any SRS in the input itself. Can be specified as a WKT, proj.4 or EPSG string. [Default: none]
header
A comma-separated list of Dimensions IDs to map bands to. The length of the list must match the number of bands in the raster.