[libpc] Producer/Consumer

Michael P. Gerlek mpg at flaxen.com
Mon Mar 7 19:28:16 EST 2011


The more I think about it, the more I'm thinking the hierarchy we have is
still not quite right.  The PointData abstraction is okay, but how you talk
to a data source is still open for debate.

First, I think we need to remove read() from the base Stage class -- it
should just have the header (list of dimensions, total number of points,
spatial bounds) and declare not any point reading functions.

Producer derives from Stage, and adds the ability to read points.  But
should we really be accessing points sequentially only?  With the model
right now, an OCI reader would (I think) not really have the concept of
reading a sequential list of points, since OCI really wants you to request
points by a given region, right?

So maybe the basic read() operation should be more like

    N = readBegin(<region>)    # returns num points in region
    readBuffer(N points)     # maybe this is done in chunks
    readEnd()

This model would work for sequential readers (like a LAS file) if you assume
the <region> is the degenerate case of the whole file's bounding box.

Or maybe we really should have two readers models -- SequentialProducer and
SpatialProducer -- the former being what we have now, and the latter being
defined as request-by-spatial-region.

-mpg




More information about the libpc mailing list