1

I want to save a las file, and save x,y,z,intensity and reflectance attribute.

The code runs and doesn't return any error; anyway, the reflectance attribute is not available in the file, when I open it in CloudCompare.

Do i need to somehow modify the header to be able to "detect" the reflectance attribute, which is not a standard one? In that case, how can i do that?

I'm running the code:

input= laspy.file.File("inputFile.las", mode='r')
header = laspy.header.Header()
outfile = laspy.file.File("...file.las", mode="w", header=header)
xmin = np.floor(np.min(input.x))
ymin = np.floor(np.min(input.y))
zmin = np.floor(np.min(input.z))
outfile.header.offset = [xmin, ymin, zmin]
outfile.header.scale = [0.001, 0.001, 0.001]
outfile.x = input.x
outfile.y = input.y
outfile.z = input.z
outfile.intensity = input.intensity.astype(int)
outfile.set_reflectance = input.reflectance.astype(int)
outfile.close()

Moreover, if I would make it more generic, and set, in the outfile, an uncommon attribute that we can call, as an example "NewAttribute", how should I modify the code?

I will not run:

outfile.set_NewAttribute = input.reflectance.astype(int)

Because if won't find that command.

Thanks for the help.

Sbobby
  • 33
  • 7
  • Moreover, is it correct to specify the integer type? Probably not; what is the best type I should set for this attribute? – Sbobby Nov 07 '22 at 07:04

0 Answers0