Util¶
The laspy util module holds useful data structures and functions needed in multiple locations, but not belonging unambiguously to File, Reader/Writer, or Header
- class laspy.util.Format(fmt, overwritable=False, extra_bytes=False, extradims=[])[source]¶
A Format instance consists of a set of
laspy.util.Specobjects, as well as some calculated attributes and summary methods. For example, Format builds the pt_fmt_long attribute, which provides astructcompatible format string to pack and unpack an entire formatted object (laspy.util.Pointin particular) in its entirety. Format additionally supports thelaspy.util.Format.xmlandlaspy.util.Format.etreemethods for interrogating the members of a format. This can be useful in finding out what dimensions are available from a given point format, among other things.- __init__(fmt, overwritable=False, extra_bytes=False, extradims=[])[source]¶
Build the
laspy.util.Formatinstance.
- etree()[source]¶
Return an XML etree object, describing all of the
laspy.util.Specobjects belonging to the Format.
- xml()[source]¶
Return an XML Formatted string, describing all of the
laspy.util.Specobjects belonging to the Format.
- class laspy.util.Point(reader, bytestr=False, unpacked_list=False, nice=False)[source]¶
A data structure for reading and storing point data. The latest version of laspy’s api does not use the Point class’ reading capabilities, and it is important to note that reading and writing points does not require a list of point instances. See
laspy.file.pointsfor more details- make_nice()[source]¶
Turn a point instance with the bare essentials (an unpacked list of data) into a fully populated point. Add all the named attributes it possesses, including binary fields.
- pack()[source]¶
Return a binary string representing the point data. Slower than
numpy.array.tostring, which is used bylaspy.base.DataProvider.
- class laspy.util.Spec(name, offs, fmt, num, pack=False, ltl_endian=True, overwritable=True, idx=False)[source]¶
Holds information about how to read and write a particular field. These are usually created by
laspy.util.Formatobjects.