[Liblas-devel] Re: Writing Scan Angle Rank values
Mateusz Loskot
mateusz at loskot.net
Thu May 1 15:34:22 EDT 2008
Howard Butler wrote:
>
> On May 1, 2008, at 1:11 PM, Howard Butler wrote:
>
>> Mateusz,
>>
>> The specification says the following for Scan Angle:
>>
>> Scan Angle Rank (-90 to +90) – Left side unsigned char 1 byte *
>>
>> We are doing the following:
>> int8_t GetScanAngleRank() const;
>> void SetScanAngleRank(int8_t const& rank);
>>
>> int8_t is defined as:
>>
>> typedef signed char int8_t;
>>
>>
>> If I write the following:
>> p = point.Point()
>> p.scan_angle = -90
>>
>> The Scan Angle returned is:
>>
>> Scan Angle Rank: 166
>>
>>
>> Do you have any idea why the Scan Angle Ranks cannot be roundtripped?
>> I would expect the Scan Angle Rank to be -90 in the file as I have set
>> it. The specification is unclear to me. If we are supposed to store
>> Scan Angle Rank as an unsigned char, how are we to store negative
>> values? Are we supposed to determine +/- from the Scan Direction and
>> then store 0-90 in the Scan Angle Rank?
>
>
> My dumb. I was using uint8_t in the C API and clipping things off.
> Sorry. Fixed in r626 http://liblas.org/changeset/626/
Ah, OK.
Honestly, it was a big mystery to me why the value is wrong.
Greetings
--
Mateusz Loskot
http://mateusz.loskot.net
More information about the Liblas-devel
mailing list