Giter VIP home page Giter VIP logo

Comments (9)

grantbrown avatar grantbrown commented on July 20, 2024

Hmm, is the Windows 7 installation also 64 bit? This includes not only the OS, but the version of python/numpy. If you're running a 32 bit version, I could imagine that there might not be 700MB of addressable space left after the OS and whatever other programs are running.

from laspy.

KAMI911 avatar KAMI911 commented on July 20, 2024

Thank you for the lightning fast response :)
I am using 64 bit version of Windows 7. I installed Python 2.7.10 64 bit version then tried 32 bit version too (then back to 64 bit). Both has same problem. I am not sure if I had lots of free memory because I ran several programs, but tomorrow I will check it after a restart. However I implemented multiprocessing capabilities to the converter finally I have tried on single process.

from laspy.

KAMI911 avatar KAMI911 commented on July 20, 2024

I tried it again after I restarted the machine. But I get same error.
Running python fro cmd shows:
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on wi
n32
Do yo have other ideas what causes this problem?

from laspy.

grantbrown avatar grantbrown commented on July 20, 2024

That's really odd, I've only seen that error before for 32 bit machines.

I don't think it should be possible on 64 bit python, but is there any chance you're using 32 bit Numpy?

Alternatively, you can try to get some more information about the problem by changing line 108 and 109 of base.py from:

except(Exception): 
    raise laspy.util.LaspyException("Error mapping file.")

to:

except Exception as e: 
    print(type(e))
    print(e)
    raise laspy.util.LaspyException("Error mapping file.")

and then reinstalling/re-running. It would also be helpful if you could reproduce this error with a publicly available *.las file from somewhere like liblas, then I could dig into the issue on my Windows machine.

from laspy.

KAMI911 avatar KAMI911 commented on July 20, 2024

Hi,
What I see (from Task Manager) I am running 64 bit CMD.exe then 64 bit Python. Numpy is using 64 bit (installed from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy).

Finally I have added this:

        except Exception as e:
            traceback.print_exc()
            print(type(e))
            print(e)
            raise LaspyException("Error mapping file.")

And got this:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\base.py", line 89, in map
    self._mmap = mmap.mmap(self.fileref.fileno(), 0, access = mmap.ACCESS_READ)
ValueError: cannot mmap an empty file
Traceback (most recent call last):
  File "C:/development/wgslas2eovlas/wgslas2eovlas.py", line 235, in <module>
    main()
  File "C:/development/wgslas2eovlas/wgslas2eovlas.py", line 229, in main
    ConvertLas(d)
  File "C:/development/wgslas2eovlas/wgslas2eovlas.py", line 106, in ConvertLas
    lasFiles.Open()
  File "C:\development\wgslas2eovlas\lib\LasPyConverter.py", line 20, in Open
    self.__SourceOpenedFile = laspy.file.File(self.__SourceFileName, mode='r')
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\file.py", line 62, in __init__
    self.open()
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\file.py", line 73, in open
    self._reader = base.Reader(self.filename,mode= self._mode)            
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\base.py", line 156, in __init__
    self.setup_read_write(vlrs, evlrs)
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\base.py", line 167, in setup_read_write
    self.data_provider.map() 
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\base.py", line 98, in map
    raise LaspyException("Error mapping file.")
laspy.util.LaspyException: Error mapping file.
<type 'exceptions.ValueError'>
cannot mmap an empty file

I will try a publicly available las file, and come back to you soon.

from laspy.

KAMI911 avatar KAMI911 commented on July 20, 2024

Hi,
I tried to convert this: http://www.liblas.org/samples/lt_srs_rt-qt-1.1.las

and got this error message:

25-06-2015 18:32:53 INFO [MainProcess] Opening C:\Users\kszalai\Downloads\lt_srs_rt-qt-1.1.las LAS PointCloud file for converting to C:\Users\kszalai\Downloads\out LAS PointCloud file ... Source projections is: "+proj=geocent +ellps=WGS84 +datum=WGS84 +no_defs", destination projection is: "+proj=somerc +lat_0=47.14439372222222 +lon_0=19.04857177777778 +k_0=0.99993 +x_0=650000 +y_0=200000 +ellps=GRS67 +nadgrids=C:/development/wgslas2eovlas\grid\etrs2eov_notowgs.gsb +geoidgrids=C:/development/wgslas2eovlas\grid\geoid_eht.gtx +units=m +no_defs".
----
Traceback (most recent call last):
  File "C:/development/wgslas2eovlas/wgslas2eovlas.py", line 235, in <module>
    main()
  File "C:/development/wgslas2eovlas/wgslas2eovlas.py", line 229, in main
    ConvertLas(d)
  File "C:/development/wgslas2eovlas/wgslas2eovlas.py", line 106, in ConvertLas
    lasFiles.Open()
  File "C:\development\wgslas2eovlas\lib\LasPyConverter.py", line 20, in Open
    self.__SourceOpenedFile = laspy.file.File(self.__SourceFileName, mode='r')
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\file.py", line 62, in __init__
    self.open()
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\file.py", line 73, in open
    self._reader = base.Reader(self.filename,mode= self._mode)            
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\base.py", line 156, in __init__
    self.setup_read_write(vlrs, evlrs)
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\base.py", line 177, in setup_read_write
    self.data_provider.point_map()
  File "C:\Python27\lib\site-packages\laspy-1.2.5-py2.7.egg\laspy\base.py", line 58, in point_map
    offset = self.manager.header.data_offset)
ValueError: buffer size must be a multiple of element size

What If I compress my Python folder and upload somewhere? Probably I can upload my point cloud but for this I need a permission.

from laspy.

grantbrown avatar grantbrown commented on July 20, 2024

It looks like your issue may be related to a difference in the mmap library between Windows and Linux. See this for a description. Are you certain that the file you're trying to open is not corrupt, and isn't empty?

I should have been more specific about the sample to use - many of the files hosted there are broken on purpose for testing. Try the las file in this archive.

from laspy.

KAMI911 avatar KAMI911 commented on July 20, 2024

It seems the problem is caused by a batch of invalid las file that went wrong during my test. I freshly copied all the files and now the problem is solved. I create a pull request that adds more information to this error and draw attention to the possible input file error.

from laspy.

KAMI911 avatar KAMI911 commented on July 20, 2024

Thank you for your help!

from laspy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.