Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def verify(self):
## Set global varibles for convenience.
file_1 = self.args.file_1[0]
file_2 = self.args.file_2[0]
PRESERVE = self.args.b
## Try to open both files in read mode.
try:
inFile1 = laspy.file.File.File(file_1,mode= "r")
inFile2 = laspy.file.File.File(file_2,mode= "r")
except Exception as error:
print("Error reading in files:")
print(error)
quit()
## Set global flag to indicate whether we need to look at incompatible
## bit field bytes.
SUB_BYTE_COMPATIBLE = ((inFile1.header.data_format_id <= 5) ==
(inFile2.header.data_format_id <= 5))
## Warn the user if they chose not to check incompatible point formats.
if (not SUB_BYTE_COMPATIBLE) and (not PRESERVE):
print("""WARNING: Point formats %i and %i have mismatched sub-byte fields.
The default behavior in this case is to ignore these fields during
the file_verify procedure. If you want laspy to attempt to match up
sub-byte data between these two formats, specify -b=True
def verify(self):
## Set global varibles for convenience.
file_1 = self.args.file_1[0]
file_2 = self.args.file_2[0]
PRESERVE = self.args.b
## Try to open both files in read mode.
try:
inFile1 = laspy.file.File.File(file_1,mode= "r")
inFile2 = laspy.file.File.File(file_2,mode= "r")
except Exception as error:
print("Error reading in files:")
print(error)
quit()
## Set global flag to indicate whether we need to look at incompatible
## bit field bytes.
SUB_BYTE_COMPATIBLE = ((inFile1.header.data_format_id <= 5) ==
(inFile2.header.data_format_id <= 5))
## Warn the user if they chose not to check incompatible point formats.
if (not SUB_BYTE_COMPATIBLE) and (not PRESERVE):
print("""WARNING: Point formats %i and %i have mismatched sub-byte fields.
The default behavior in this case is to ignore these fields during
the file_verify procedure. If you want laspy to attempt to match up