[pdal] Array Dimensions

Chris Foster chris.foster at roames.com.au
Sun Jun 30 18:32:35 PDT 2013


Hi all,

Sorry to bombard the list with so much mail, I'll try to hold off a bit after
this one.

After a bit of hacking on the weekend I'm fairly confident that pdal will work
for us, with the possible exception of one major feature which appears to be
missing from PointBuffer: Dimensions which hold short fixed size arrays rather
than single elements.

The problem is that sometimes a Dimension logically contains more than one
element, and it doesn't make sense to name the elements independently.  For
example, suppose I want to write a filter which computes local geometric
properties using the eigenstructure of the local covariance matrix.  The
output from this is naturally represented as a 3-vector of eigenvalues and a
3x3 matrix of eigenvectors per point.  Now, I could name each of these using
their own Dimension, but that introduces unnecessary overhead and the
resulting components don't make logical sense on their own.

I'm imagining something like

PointBuffer buf(...);
const Dimension& eigenValuesDim = buf.getSchema().getDimension("EigenValues");
// ...
float* vals = buf.getArrayField<float>(eigenValuesDim, 0);

If the size is known at compile time, the following would pretty much work
already

const boost::array<float,9>& vals =
    buf.getField<boost::array<float,9> >(eigenValuesDim, 0);


Other libraries agree that this is a useful feature, for example PCL has
explicit support for it in their PCD file format.

I'm certainly willing to write code to make this work, but I'm not sure how
large a job it would be, so I'd need some guidance about whether it's a
desired feature before I start anything.  If not, I may have to implement a
point buffer class of my own, but I like to avoid reinventing wheels where
possible.


Thanks,
~Chris


More information about the pdal mailing list