[pdal] Scaling of dimensions when writing to las

Howard Butler hobu.inc at gmail.com
Thu Jun 27 07:59:31 PDT 2013


On Jun 26, 2013, at 11:46 PM, Chris Foster <chris.foster at roames.com.au> wrote:

> One thing which isn't clear to me is how quantization works when
> output to las is desired.

The drivers.las.writer will take the first "X" dimension it finds in the schema (in this case it is the X dimension of double's from the drivers.faux.reader), cast it to a int32_t, and write that into the file. It is on you to make sure that the data are appropriately scaled and match the header of the LAS file you are writing.

For example, the following pipeline will set the scale for the X, Y, Z dimensions to 0.1, and set the offset to 2.0. The drivers.faux.reader will simply return doubles between 0-10 for X, Y, and 0-2 for Z. 

Make sure to take a peek at the pipeline xml files in test/data for inspiration on filters and operations to try.

Hope this helps,

Howard

<?xml version="1.0" encoding="utf-8"?>
<Pipeline version="1.0">
    <Writer type="drivers.las.writer">
        <Option name="filename">
            faux.las
        </Option>
    <Filter type="filters.scaling">
        <Option name="dimension">
            X
            <Options>
                <Option name="scale">0.1</Option>
                <Option name="offset">1.0</Option>
            </Options>
        </Option>
        <Option name="dimension">
            Y
            <Options>
                <Option name="scale">0.1</Option>
                <Option name="offset">2.0</Option>
            </Options>
        </Option>
        <Option name="dimension">
            Z
            <Options>
                <Option name="scale">0.1</Option>
                <Option name="offset">2.0</Option>
            </Options>
        </Option>        
        <Reader type="drivers.faux.reader">
            <Option name="mode">
                random
            </Option>
            <Option name="bounds">
                ([0,10],[0,10],[0,2])
            </Option>
            <Option name="num_points">
                100000
            </Option>
        </Reader>
    </Filter>
</Writer>
</Pipeline>



More information about the pdal mailing list