[Liblas-devel] GetClassification() et al.
Peder Axensten
Peder.Axensten at slu.se
Tue Oct 25 03:07:24 EDT 2011
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.
Very best regards,
/Peder
On 24 okt 2011, at 16:49, Mateusz Łoskot wrote:
> On 24 October 2011 15:21, Peder Axensten <Peder.Axensten at slu.se> wrote:
>> I'm interested in retrieving and setting all the eight bits at once.
>
> Point p;
> Classification c(7, true /*synthetic*/, false /*keypoint*/, true
> /*withheld*/); // set all bits of classification
Yes, it does.
> p.SetClassification(c); // set point with classification
No, it only sets the "7" -- synthetic, key point, and withheld values are ignored.
>
> You can also modify:
>
> c.SetKeyPoint(true); // modify classification
> p.SetClassification(c); // set point with modified classification
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> Charter Member of OSGeo, http://osgeo.org
> Member of ACCU, http://accu.org
> _______________________________________________
> Liblas-devel mailing list
> Liblas-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/liblas-devel
More information about the Liblas-devel
mailing list