[pdal] FieldChooserFilter

Howard Butler hobu.inc at gmail.com
Thu Aug 18 16:54:09 EDT 2011


On Aug 18, 2011, at 10:35 AM, Michael P. Gerlek wrote:

> Thinking out loud...
> 
> Readers often produce fields one doesn't want or care about, so It Would Be
> Nice to have a filter that removes them for you.  But you often don't know
> the name of the field you want to remove -- maybe you only know you want to
> preserve a few known fields.
> 
> So how about a filter that takes a list of strings in its ctor to give
> instructions as to how to do this.  Consider the following syntax:
> 
> 	=name		- means "preserve" field 'name', if present
> 	-name		- means "remove" field 'name', if present
> 	+name		- means "add" field 'name' (initializing values to
> zero, I suppose)
> 	-*		- means "remove" any fields not previously mentioned
> 	=*		- means "preserve" any fields not previously
> mentioned
> 
> (I added the '+' and '=*' operators for completeness.  '+*' doesn't make
> sense, however.)  This would be  very easily to implement in the
> initialize() routine, using a simple mark/sweep pass over the fields given
> by the previous stage.
> 
> Example 1: "remove everything but the X,Y,Z fields"
> 
> 	=x, =y, =z, -*
> 
> Thoughts?


Sounds good and I could have used it more than a few times.

Does this filter result in the PointBuffer's data being copied/composed? The scaling filter currently has to copy along all of the other fields' data, and this is a performance hit because the PointBuffer's composition has changed (dropped int-based XYZ and added double-based XYZ or vice versa).  

Howard


More information about the pdal mailing list