[Liblas-devel] floating point round off problem in libLAS Python API

Mateusz Łoskot mateusz at loskot.net
Thu Mar 13 01:35:38 PDT 2014


On 13 March 2014 05:02, Jitendra Kumar <jitendra.ornl at gmail.com> wrote:
>
> I am trying to use libLAS Python API to write point data sets to *.las file.
> But I am experiencing some problems with the floats values being rounded off
>
>>>> from liblas import point
>>>> pt=point.Point()
>>>> pt.x=2.323
>>>> pt.x
> 2.0
>>>>
>
> If I set the pt.raw_x instead of pt.x I don't see the rounding off problem
> but no las file is written.
>
>>>> pt.raw_x=2.323
>>>> pt.raw_x
> 2.323
>
> I am not sure what am I missing. I would appreciate any help with this.

There is no header yet, or there is the default header with scale 1.0
and offset 0.0.
See comment here
https://github.com/libLAS/libLAS-1.6/blob/master/python/liblas/point.py#L101

Regards,
-- 
Mateusz  Łoskot, http://mateusz.loskot.net


More information about the Liblas-devel mailing list