[pdal] FieldChooserFilter

Michael P. Gerlek mpg at flaxen.com
Thu Aug 18 11:35:41 EDT 2011


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?

-mpg




More information about the pdal mailing list