I am trying to learn LASPY and am running into road blocks off the bat. I first ran into and Error 8 (Not enough storage is available to process this command) using my full sized LAS file (1.7GB). I was able to get around it by using FUSION's polyclipdata to create multiple smaller sized LAS files; just frustrating. The second road block I have run into, and I can't find out much about it, is:

ValueError: buffer size must be a multiple of element size

when I try:

import laspy
import numpy as np
from laspy import file
infile = file.File("F:/P834/temp/pointfile3_2.las", mode="r")

Error occurs on line 4.

I am trying to work through the tutorial http://laspy.readthedocs.io/en/latest/tut_part_1.html

What am I missing in my early start?

Full error printout:

Traceback (most recent call last):
  File "F:/P834/laspy/laspy_tests.py", line 2, in <module>
    infile = laspy.file.File('F:/P834/temp/pointfile3_2.las', mode='r')
  File "C:\Python27\ArcGIS10.3\lib\site-packages\laspy\file.py", line 64, in __init__
  File "C:\Python27\ArcGIS10.3\lib\site-packages\laspy\file.py", line 75, in open
    self._reader = base.Reader(self.filename, mode=self._mode)
  File "C:\Python27\ArcGIS10.3\lib\site-packages\laspy\base.py", line 273, in __init__
    self.setup_read_write(vlrs,evlrs, read_only=True)
  File "C:\Python27\ArcGIS10.3\lib\site-packages\laspy\base.py", line 321, in setup_read_write
  File "C:\Python27\ArcGIS10.3\lib\site-packages\laspy\base.py", line 163, in point_map
ValueError: buffer size must be a multiple of element size
  • Are you importing the tiled las data from FUSION?
    – Aaron
    Feb 28 '18 at 16:32
  • 1
    In other words, using laspy, are you trying to import a tiled las file that was created using FUSION?
    – Aaron
    Feb 28 '18 at 16:35
  • 2
    You may be trying to import a corrupted file. Try importing another las file using laspy to see if your tiled las data is in fact corrupted: matsu.gina.alaska.edu/LiDAR/Caswell_Lakes/Point_Cloud/…
    – Aaron
    Feb 28 '18 at 16:38
  • 1
    That file worked, i can see the results.... how do I do this for my larger dataset?
    – D_C
    Feb 28 '18 at 16:43
  • 1
    Great, thanks for opening a new question. I would recommend either adding your own answer to this question (e.g. I was working with corrupt data) or closing this question so that we can consider this question resolved. Also, if you are interested in the lidR package, check out @JRR's github page which has many tutorials: github.com/Jean-Romain/lidR
    – Aaron
    Feb 28 '18 at 17:00

As determined while working through the problem with Aaron, I figured out I was working with corrupt data, because applying the same code to other .las file worked (here is the alternative file used).

I have opened another question related to why FUSION is creating corrupt data when using the polyclipdata module here: FUSION polyclipdata creates corrupt LAS file


I ran into the same error with las files containing EXTRA_BYTE information generated with lasheight from LAStools. After removing the EXTRA_BYTE information laspy had no issue to open the files.

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .