[Liblas-devel] GetClassification() et al.

Mateusz Łoskot mateusz at loskot.net
Wed Oct 26 05:16:34 EDT 2011


2011/10/26 Peder Axensten <Peder.Axensten at slu.se>:
>> I presented bug and fix here: https://gist.github.com/1313176
>
> Should not the other two be fixed too:
>        void Point::SetClassification(Classification::bitset_type const& flags) and
>        void Point::SetClassification(boost::uint8_t const& flags)?

Yes, they should.

> Maybe a few unit tests using the various SetClassification(...) to check for this bug?

Patches are welcome, I guess.

> The only way to retrieve the uint8_t (m_data[15]) as a uint8_t is through conversion to unsigned long and back?

Yes. This is because I decided to use std::bitset users convenience to
be able to play with bit flags easier.
LAS classification is not 1 byte, but it's 4 different kinds of
information encoded in space of 1 byte
in order to save some space. Main purpose of liblas::Classification is
to represent the classification concept
and attributes, but not its low-level implementation.

> (By static_cast<boost::uint8_t>(bits.to_ulong()).)

or syntax sugar of functional notation which is equivalent:

boost::uint8_t(bits.to_ulong()))

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org


More information about the Liblas-devel mailing list