How to use the laspy.base.FileManager function in laspy

To help you get started, we’ve selected a few laspy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laspy / laspy / laspy / base.py View on Github external
return(self.get_dimension("y_t"))

    def get_z_t(self):
        return(self.get_dimension("z_t"))

    def get_extra_bytes(self):
        if "extra_bytes" in self.point_format.lookup.keys():
            return(self.get_dimension("extra_bytes"))
        elif self.extra_dimensions != []:
            newmap = self.data_provider.get_point_map(self.naive_point_format)
            return(newmap["point"]["extra_bytes"])
        else:
            raise laspy.util.LaspyException("Extra bytes not present in record")


class Reader(FileManager):
    '''Just a subclass of FileManager'''
    pass

class Writer(FileManager):

    def close(self, ignore_header_changes = False, minmax_mode = "scaled"):
        '''Flush changes to mmap and close mmap and fileref'''
        if (not ignore_header_changes) and (self.has_point_records):
            if not self._header_current:
                self.header.update_histogram()
            self.header.update_min_max(minmax_mode)
        super(Writer, self).close()

    def set_evlrs(self, value):
        if value == False or len(value) == 0:
            return
github laspy / laspy / laspy / base.py View on Github external
def get_extra_bytes(self):
        if "extra_bytes" in self.point_format.lookup.keys():
            return(self.get_dimension("extra_bytes"))
        elif self.extra_dimensions != []:
            newmap = self.data_provider.get_point_map(self.naive_point_format)
            return(newmap["point"]["extra_bytes"])
        else:
            raise laspy.util.LaspyException("Extra bytes not present in record")


class Reader(FileManager):
    '''Just a subclass of FileManager'''
    pass

class Writer(FileManager):

    def close(self, ignore_header_changes = False, minmax_mode = "scaled"):
        '''Flush changes to mmap and close mmap and fileref'''
        if (not ignore_header_changes) and (self.has_point_records):
            if not self._header_current:
                self.header.update_histogram()
            self.header.update_min_max(minmax_mode)
        super(Writer, self).close()

    def set_evlrs(self, value):
        if value == False or len(value) == 0:
            return
        if not all([x.isEVLR for x in value]):
            raise laspy.util.LaspyException("set_evlrs requers an iterable object " +
                        "composed of :obj:`laspy.header.EVLR` objects.")
        elif self.mode == "w+":