Questions tagged [laspy]

Laspy is a python library for reading, modifying and creating .LAS LIDAR files.

Laspy is a python library for reading, modifying and creating .las LIDAR files.

Official documentation: http://pythonhosted.org/laspy/

32 questions
0
votes
0 answers

LaspyException: Invalid file signature "b'\xca\x8d\xa0?'" (trying to convert .laz to .las using phyton)

I got an error trying to run the code below. The code tries to convert a .laz file into a .las file. The first file with the name 06bn1 has no trouble converting, but other files give the error message: LaspyException: Invalid file signature…
CedricS
  • 1
  • 2
0
votes
1 answer

Iteratively open a .las file, perform some operations, and save a new .las file with the same name

i have a folder with several .las files. My goal is to create a loop, in which iteratively i open a .las file, i perform some operations (which i already know they work), and then generate a new .las file, in another folder, with the same name of…
Sbobby
  • 33
  • 7
0
votes
0 answers

how to convert .stcm file to pointcloud or CSV

I have a lidar that gives me output as a test.stcm I want to write a script that converts the .stcm to CSV or point cloud form. I used the following script but it doesn't work import laspy import pcl # # Open the .stcm file inFile =…
Mubahsir
  • 45
  • 9
0
votes
1 answer

How do I save color to las file using laspy

I have been trying to add color to my point cloud. I want to add red green and blue but for now, I am only adding red to simplify the problem. I want to be using chunks to read the file. Right now when I read the file back I get an array of…
Joe
  • 1
  • 1
0
votes
0 answers

getting e notation values when stacking into a numpy array in python

I am stacking point clouds into one array using np.stack but when i see the result the values are shown in e notation. if i only stack x and y then the values are not shown in e notation only if i add the z column its shown in e notation for…
Purple_Ad
  • 65
  • 6
0
votes
0 answers

How to save integer numbers in laspy attribute

I'm trying to save a new attribute to define the ID of objects in my point cloud. So, we are talking about integer numbers, from 1 to 500. My actual code is: outfile.define_new_dimension(name = "id", data_type = 9, description = "id") outfile.id =…
Sbobby
  • 33
  • 7
0
votes
0 answers

Define new attribute while writing laspy file

I want to write an array in a .las file with laspy. I'm running the code: inFile = laspy.file.File(inputFile, mode='r') outfile = laspy.file.File("....file.las", mode="w", header=header) outfile.define_new_dimension(name = "newatt1",…
Sbobby
  • 33
  • 7
0
votes
0 answers

Split a point cloud (las file) with classification values

I have a classified point cloud (.las file) I would like to split it in several smaller point clouds, with respect to the classification values. I can do it in a non-iterative way: ground=xyz[np.where(xyz[:,6] == 2)] header =…
Sbobby
  • 33
  • 7
0
votes
0 answers

"LaspyException: Invalid Data: Packed Length is Greater than allowed" when converting numpy array in las file with Laspy

i'm trying to convert a numpy array in a las file with numpy. I started with a las file, I imported with laspy and I converted it in a numpy array with 6 columns (x,y,z,intensity,return number, classification). I then performed some algorithms,…
Sbobby
  • 33
  • 7
0
votes
1 answer

Convert Numpy array in las file with laspy

I'm trying to save a NumPy array in a las file. The problem is that the file that is created only contains x y z coordinates, and no info related to intensity, classification, and return number are stored. Here it is my code. I think it's a problem…
Sbobby
  • 33
  • 7
0
votes
1 answer

Is there a way to convert chunks of las file to another las file type?

The converting function seems to only work if you do laspy.read(). However, the whole point of the chunk iterator is so you don't have to read in a full file at a time. This is how I thought an example of laspy.convert() would work with the chunk…
Joe
  • 1
  • 1
0
votes
0 answers

Change point clouds IDs with respect to a relationship defined in an array

I'm a new user of Python. I'm trying to change ID to points in a point cloud. My point cloud has already a classification, so each point has got different IDs. I have an array that relates these IDs to new ones, something like: ID_relation [[1, 50],…
Sbobby
  • 33
  • 7
0
votes
1 answer

Define new dimension while writing laspy file

How can I add data to a custom defined dimension when saving a laspy file (.las) in python? Ok, more details: I read a standard .las file with attributes X,Y,Z,I. Then I do some calculations and want to save the result as a .las file with attributes…
trippeljojo
  • 65
  • 1
  • 11
0
votes
1 answer

problem in reading las file using liblas and laspy in python

I pip installed liblas, which got installed perfectly, but still, when I'm trying to import liblas it's raising an error which is shown in the 1st error. then I pip installed laspy, which installed perfectly and tried to read my las file from that…
user10867289
0
votes
1 answer

Finding points in LAS file by coordinates

I am trying to find points in a LAS file (Lidar format): Right now I am doing it the really slow way: from laspy.file import File import numpy as np inFile = File('inputfile.las', mode='r') coord = np.vstack((inFile.x, inFile.y,…
fsp
  • 515
  • 6
  • 21