0

Im detecting trees and want to create a .las file to be able to display it in Cloud Compare. I can not wrap my head around why this is not working. The scale should allow for 6 decimal points but it is rounded to the nearest int each time.

    outFile = File("trees.las", mode="w", header=ransac.dataFile.header)

    print(trees[:, 0])
    print(type(trees[:, 0]))
    print(outFile.header.scale)

    outFile.X = trees[:, 0]

    print(outFile.X)

    outFile.Y = trees[:, 1]
    outFile.Z = trees[:, 2]
    outFile.close()

This is the printed values

[77.679703 77.6772   77.675003 ... 78.716003 78.696198 78.674599]
<class 'numpy.ndarray'>
[1e-06, 1e-06, 1e-06]
[77 77 77 ... 78 78 78]

All help will be appriciated!

1 Answer 1

2

Turns out all you have to do is to change X, Y, Z to not be capital letters like this.

    outFile.x = trees[:, 0]
    outFile.y = trees[:, 1]
    outFile.z = trees[:, 2]
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.