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.Spec objects, as well as some calculated attributes and summary methods. For example, Format builds the pt_fmt_long attribute, which provides a struct compatable format string to pack and unpack an entire formatted object (laspy.util.Point in particular) in its entireity. Format additionally supports the laspy.util.Format.xml and laspy.util.Format.etree methods 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.Format instance.

__getitem__(index)[source]

Provide slicing functionality: return specs[index]

__iter__()[source]

Provide iterating functionality for spec in specs

etree()[source]

Return an XML etree object, describing all of the laspy.util.Spec objects belonging to the Format.

xml()[source]

Return an XML Formatted string, describing all of the laspy.util.Spec objects 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 lastest 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.points for more details

pack()[source]

Return a binary string representing the point data. Slower than numpy.array.tostring, which is used by laspy.base.DataProvider.

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.

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.Format objects.

__init__(name, offs, fmt, num, pack=False, ltl_endian=True, overwritable=True, idx=False)[source]

Build the spec instance.

class laspy.util.LaspyException[source]

LaspyException: indicates a laspy related error.

Previous topic

Base