Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open laz file in read and write mode failed #73

Closed
arthur-leguennec opened this issue Oct 19, 2017 · 12 comments
Closed

Open laz file in read and write mode failed #73

arthur-leguennec opened this issue Oct 19, 2017 · 12 comments

Comments

@arthur-leguennec
Copy link

Hello everyone,

I'm trying to open a laz file to read and write on the classification. But when I run this command:
inFile = File("test.laz", mode = "rw")
I have the following message:

File "D:\Program Files (x86)\Python36-64\lib\site-packages\laspy\file.py", line 64, in __init__
self.open()
File "D:\Program Files (x86)\Python36-64\lib\site-packages\laspy\file.py", line 94, in open
self._writer = base.Writer(self.filename,mode = self._mode)
File "D:\Program Files (x86)\Python36-64\lib\site-packages\laspy\base.py", line 268, in __init__
self.setup_read_write(vlrs, evlrs, read_only=False)
File "D:\Program Files (x86)\Python36-64\lib\site-packages\laspy\base.py", line 293, in setup_read_write
self.data_provider.map()
File "D:\Program Files (x86)\Python36-64\lib\site-packages\laspy\base.py", line 209, in map
raise laspy.util.LaspyException("Error mapping file: " + str(e))
laspy.util.LaspyException: Error mapping file: 'bool' object has no attribute 'fileno'

If someone knows why I have this, I'll happy to know the answer!
I work on windows 10 64 bits, Python 3.6.2 and laspy 1.5.0

Thanks,
Arthur

@arthur-leguennec
Copy link
Author

Just a precision (i remarked this just now ...), it works with a las file

@grantbrown
Copy link
Collaborator

Hmm, does it work on the las file which is equivalent to the laz file you're working with? That is, if you extract the laz file using lazip, does laspy read the result correctly?

@arthur-leguennec
Copy link
Author

Yes, it's works with the same point cloud if it's a las but not a laz. And it's doesn't change if I extract a las file with laszip

@grantbrown
Copy link
Collaborator

Can you replicate the error with version 1.5.1 from GitHub? (I just incremented the version because we got behind on that. There are some changes which haven't been deployed to the package index).

@zwnk
Copy link

zwnk commented Jul 30, 2018

i get the same when opening a laz file in rw mode.
laspy 1.5.1 is installed.

@grantbrown
Copy link
Collaborator

Laspy doesn't support rw for laz files, but should probably give a better error. Laz files are currently read-only.

@zwnk
Copy link

zwnk commented Sep 10, 2018

good to know :)

@Sajjadmanal
Copy link

@grantbrown @arthur-leguennec How can I read .laz file using laspy? I am getting below error:
LaspyException: Error mapping file: Laszip was not found on the system

@niranjanreddy891
Copy link

niranjanreddy891 commented Aug 20, 2019

Error says Laszip is missing. Install laszip and try again

@Sajjadmanal
Copy link

@niranjanreddy891 I installed laszip using :
conda install -c conda-forge laszip

I checked it is installed successfully using: conda list
Ran again but I gives me the same error.

@DineshChandra94
Copy link

DineshChandra94 commented Dec 12, 2019

@Sajjadmanal
After installing laszip download laszip-cli.exe from here and add its path to the environment. This should solve your issue.
If the above link doesn't work than you can go to https://laszip.org and then brows down to Binaries; here you should see laszip-cli.exe, download it and add its path to the environment.

@tmontaigu
Copy link
Member

Closing as laspy 2.0 support writting LAZ files (However this is not done by opening in rw mode since laspy.File does not exists anymore)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants