PDAL/PDAL — pull request #447 by gadomski (2014-09-09 21:43:43+00:00)
Title: Programmable filter can add dimensions to context

Using one or more `add_dimension` options on a programmable filter will instruct the filter to add those dimensions to the primary PointContext. This way, the programmable filter can set dimensions that might not be present on the PointContext.

My use case for this is manually scaling and "renaming" a dimension coming in from a reader, e.g. this pipeline:

```xml

output.las

true

import numpy
def reflectance_to_intensity(ins, outs):
ref = ins["Reflectance"]
min = numpy.amin(ref)
max = numpy.amax(ref)
outs["Intensity"] = (65536 * (ref - min) / (max - min)).astype(numpy.uint16)
return True

reflectance_to_intensity

pyrxp

Intensity

/home/vagrant/PDAL/test/data/rxp/130501_232206_cut.rxp

```

The **rxp** reader, which produces the "Reflectance" value, comes from [this branch](https://github.com/gadomski/PDAL/tree/rxp-driver).