python/liblas/file.py
def open(self):
        """Open the file for processing, called by __init__
        """

        if self._mode == 'r' or self._mode == 'rb':

            if not os.path.exists(self.filename):
                raise OSError("No such file or directory: '%s'" % self.filename)

            if self._header == None:
                self.handle = core.las.LASReader_Create(self.filename)
                self._header = core.las.LASReader_GetHeader(self.handle)
            else:
                self.handle = \
                core.las.LASReader_CreateWithHeader(self.filename,
                                                        self._header)
            core.las.LASHeader_Destroy(self._header)
            self._header = core.las.LASReader_GetHeader(self.handle)
            self.mode = 0
            try:
                files['read'][self.filename] += 1
            except KeyError:
                files['read'][self.filename] = 1

            if self.in_srs:
                core.las.las.LASReader_SetInputSRS(self.handle,
                                                   self.in_srs.handle)
            if self.out_srs:
                core.las.LASReader_SetOutputSRS(self.handle,
                                                self.out_srs.handle)

        if self._mode == 'w' and '+' not in self._mode:

            if self._header == None:
                self._header = core.las.LASHeader_Create()

            self.handle = core.las.LASWriter_Create(self.filename,
                                                    self._header,
                                                    1)
            core.las.LASHeader_Destroy(self._header)
            self._header = core.las.LASWriter_GetHeader(self.handle)
            self.mode = 1
            files['write'].append(self.filename)

            if self.in_srs:
                core.las.LASWriter_SetInputSRS(self.handle, self.in_srs.handle)
            if self.out_srs:
                core.las.LASWriter_SetOutputSRS(self.handle,
                                                self.out_srs.handle)

        if '+' in self._mode and 'r' not in self._mode:
            if self._header == None:
                reader = core.las.LASReader_Create(self.filename)
                self._header = core.las.LASReader_GetHeader(reader)
                core.las.LASReader_Destroy(reader)
            self.handle = core.las.LASWriter_Create(self.filename,
                                                    self._header,
                                                    2)
            core.las.LASHeader_Destroy(self._header)
            self._header = core.las.LASWriter_GetHeader(self.handle)
            self.mode = 2
            files['append'].append(self.filename)

            if self.in_srs:
                core.las.LASWriter_SetInputSRS(self.handle, self.in_srs.handle)
            if self.out_srs:
                core.las.LASWriter_SetOutputSRS(self.handle,
                                                self.out_srs.handle)
Open the file for processing, called by __init__
        
Open the file for processing, called by __init
Open the file for processing called by __init
def open(self):
        if self._mode == 'r' or self._mode == 'rb':
            if not os.path.exists(self.filename):
                raise OSError("No such file or directory: '%s'" % self.filename)
            if self._header == None:
                self.handle = core.las.LASReader_Create(self.filename)
                self._header = core.las.LASReader_GetHeader(self.handle)
            else:
                self.handle = \
                core.las.LASReader_CreateWithHeader(self.filename,
                                                        self._header)
            core.las.LASHeader_Destroy(self._header)
            self._header = core.las.LASReader_GetHeader(self.handle)
            self.mode = 0
            try:
                files['read'][self.filename] += 1
            except KeyError:
                files['read'][self.filename] = 1
            if self.in_srs:
                core.las.las.LASReader_SetInputSRS(self.handle,
                                                   self.in_srs.handle)
            if self.out_srs:
                core.las.LASReader_SetOutputSRS(self.handle,
                                                self.out_srs.handle)
        if self._mode == 'w' and '+' not in self._mode:
            if self._header == None:
                self._header = core.las.LASHeader_Create()
            self.handle = core.las.LASWriter_Create(self.filename,
                                                    self._header,
                                                    1)
            core.las.LASHeader_Destroy(self._header)
            self._header = core.las.LASWriter_GetHeader(self.handle)
            self.mode = 1
            files['write'].append(self.filename)
            if self.in_srs:
                core.las.LASWriter_SetInputSRS(self.handle, self.in_srs.handle)
            if self.out_srs:
                core.las.LASWriter_SetOutputSRS(self.handle,
                                                self.out_srs.handle)
        if '+' in self._mode and 'r' not in self._mode:
            if self._header == None:
                reader = core.las.LASReader_Create(self.filename)
                self._header = core.las.LASReader_GetHeader(reader)
                core.las.LASReader_Destroy(reader)
            self.handle = core.las.LASWriter_Create(self.filename,
                                                    self._header,
                                                    2)
            core.las.LASHeader_Destroy(self._header)
            self._header = core.las.LASWriter_GetHeader(self.handle)
            self.mode = 2
            files['append'].append(self.filename)
            if self.in_srs:
                core.las.LASWriter_SetInputSRS(self.handle, self.in_srs.handle)
            if self.out_srs:
                core.las.LASWriter_SetOutputSRS(self.handle,
                                                self.out_srs.handle)
def open ( self ) : if self . _mode == 'r' or self . _mode == 'rb' : if not os . path . exists ( self . filename ) : raise OSError ( "No such file or directory: '%s'" % self . filename ) if self . _header == None : self . handle = core . las . LASReader_Create ( self . filename ) self . _header = core . las . LASReader_GetHeader ( self . handle ) else : self . handle = core . las . LASReader_CreateWithHeader ( self . filename , self . _header ) core . las . LASHeader_Destroy ( self . _header ) self . _header = core . las . LASReader_GetHeader ( self . handle ) self . mode = 0 try : files [ 'read' ] [ self . filename ] += 1 except KeyError : files [ 'read' ] [ self . filename ] = 1 if self . in_srs : core . las . las . LASReader_SetInputSRS ( self . handle , self . in_srs . handle ) if self . out_srs : core . las . LASReader_SetOutputSRS ( self . handle , self . out_srs . handle ) if self . _mode == 'w' and '+' not in self . _mode : if self . _header == None : self . _header = core . las . LASHeader_Create ( ) self . handle = core . las . LASWriter_Create ( self . filename , self . _header , 1 ) core . las . LASHeader_Destroy ( self . _header ) self . _header = core . las . LASWriter_GetHeader ( self . handle ) self . mode = 1 files [ 'write' ] . append ( self . filename ) if self . in_srs : core . las . LASWriter_SetInputSRS ( self . handle , self . in_srs . handle ) if self . out_srs : core . las . LASWriter_SetOutputSRS ( self . handle , self . out_srs . handle ) if '+' in self . _mode and 'r' not in self . _mode : if self . _header == None : reader = core . las . LASReader_Create ( self . filename ) self . _header = core . las . LASReader_GetHeader ( reader ) core . las . LASReader_Destroy ( reader ) self . handle = core . las . LASWriter_Create ( self . filename , self . _header , 2 ) core . las . LASHeader_Destroy ( self . _header ) self . _header = core . las . LASWriter_GetHeader ( self . handle ) self . mode = 2 files [ 'append' ] . append ( self . filename ) if self . in_srs : core . las . LASWriter_SetInputSRS ( self . handle , self . in_srs . handle ) if self . out_srs : core . las . LASWriter_SetOutputSRS ( self . handle , self . out_srs . handle )
Open the file for processing, called by __init__
Open the file for processing called by __init__
"""Open the file for processing, called by __init__
        """
self