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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Jitendra Kumar-3

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.

Thanks,
Jitu

_______________________________________________
Liblas-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/liblas-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Mateusz Loskot
On 13 March 2014 05:02, Jitendra Kumar <[hidden email]> 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
_______________________________________________
Liblas-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/liblas-devel
Loading...