[Liblas-devel] GetClassification() et al.

Howard Butler hobu.inc at gmail.com
Tue Oct 25 09:23:21 EDT 2011


On Oct 25, 2011, at 2:07 AM, Peder Axensten wrote:

> I ran the following:
> 
> 	liblas::Point p;
> 	liblas::Classification c1( 7, true /*synthetic*/, false /*keypoint*/, true /*withheld*/ ); // set all bits of classification
> 	p.SetClassification( c1 ); // set point with classification
> 	liblas::Classification		c2;
> 	c2 = p.GetClassification();
> 	std::cout	<< "TEST:\n"
> 				<< "1 Synthetic: " << c1.IsSynthetic() << "\n"
> 				<< "1 Keypoint:  " << c1.IsKeyPoint() << "\n"
> 				<< "1 Withheld:  " << c1.IsWithheld() << "\n"
> 				<< "2 Synthetic: " << c2.IsSynthetic() << "\n"
> 				<< "2 Keypoint:  " << c2.IsKeyPoint() << "\n"
> 				<< "2 Withheld:  " << c2.IsWithheld() << "\n"
> 				;
> 
> 
> And I got:
> TEST:
> 1 Synthetic: 1
> 1 Keypoint:  0
> 1 Withheld:  1
> 2 Synthetic: 0
> 2 Keypoint:  0
> 2 Withheld:  0
> 
> My conclusion is that SetClassification() filters the Classification, so that only the lower 5 bits remain.
> I'd be happy if someone could correct me, but to me it seems that there is no way to set the higher bits of a Point's Classification.
> 
> Also, I'd suggest a GetRawClassification() member function to Point, to retrieve all the eight bits at once.

Peder,

Can you produce a Pull Request that does what you suggest for GetRawClassification along with fixing the clipping of the high bits?  I will incorporate it in the next release (1.7.0 final, I think) in the next couple of weeks.

Howard


More information about the Liblas-devel mailing list