Comments (6)
This error is due to the header indicating a number of points that does not match the reality.
Do other softwares (lasinfo, cloudcompare, etc) manage to open the file without error or without
printing a warning ?
If you can seend a link with the file that would help the debug
from pylas.
Hi @tmontaigu,
thank you for your help.
I'm also sending the output of lasinfo:
`---------------------------------------------------------
Header Summary
Version: 1.2
Source ID: 0
Reserved: 0
Project ID/GUID: '00000000-0000-0000-0000-000000000000'
System ID: 'EXTRACTION'
Generating Software: 'LASfunctions v.1.0'
File Creation Day/Year: 156/2017
Header Byte Size 227
Data Offset: 2145
Header Padding: 0
Number Var. Length Records: 5
Point Data Format: 3
Number of Point Records: 2023834
Compressed: False
Number of Points by Return: 1505024 444251 69170 5187 201
Scale Factor X Y Z: 0.00025000000000 0.00025000000000 0.00025000000000
Offset X Y Z: 465864.0000 5060643.0000 355.0000
Min X Y Z: 465851.8133 5060638.0048 334.1078
Max X Y Z: 466398.7130 5060851.2268 374.3673
Spatial Reference:
Reference defined, but GDAL is not available for WKT support
Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
End_Of_Tags.
Keyed_Information:
GTModelTypeGeoKey (Short,1): ModelTypeProjected
GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
GTCitationGeoKey (Ascii,28): "WGS 84 / UTM zone 32N_ortho"
GeographicTypeGeoKey (Short,1): User-Defined
GeogCitationGeoKey (Ascii,6): "WGS84"
GeogGeodeticDatumGeoKey (Short,1): User-Defined
GeogPrimeMeridianGeoKey (Short,1): User-Defined
GeogLinearUnitsGeoKey (Short,1): Linear_Meter
GeogAngularUnitsGeoKey (Short,1): Angular_Degree
GeogEllipsoidGeoKey (Short,1): User-Defined
GeogSemiMajorAxisGeoKey (Double,1): 6378137
GeogInvFlatteningGeoKey (Double,1): 298.257223563
GeogAzimuthUnitsGeoKey (Short,1): Angular_Degree
GeogPrimeMeridianLongGeoKey (Double,1): 0
ProjectedCSTypeGeoKey (Short,1): User-Defined
PCSCitationGeoKey (Ascii,28): "WGS 84 / UTM zone 32N_ortho"
ProjectionGeoKey (Short,1): User-Defined
ProjCoordTransGeoKey (Short,1): CT_TransverseMercator
ProjLinearUnitsGeoKey (Short,1): Linear_Meter
ProjNatOriginLongGeoKey (Double,1): 9
ProjNatOriginLatGeoKey (Double,1): 0
ProjFalseEastingGeoKey (Double,1): 500000
ProjFalseNorthingGeoKey (Double,1): 0
ProjScaleAtNatOriginGeoKey (Double,1): 0.9996
VerticalUnitsGeoKey (Short,1): Linear_Meter
End_Of_Keys.
End_Of_Geotiff.
VLR Summary
User: 'LASF_Projection' - Description: 'GeoKeyDirectoryTag (mandatory)'
ID: 34735 Length: 208 Total Size: 262
User: 'LASF_Projection' - Description: 'GeoDoubleParamsTag (optional)'
ID: 34736 Length: 64 Total Size: 118
User: 'LASF_Projection' - Description: 'GeoASCIIParamsTag (optional)'
ID: 34737 Length: 62 Total Size: 116
User: 'LASF_Projection' - Description: 'OGC COORDINATE SYSTEM WKT'
ID: 2112 Length: 738 Total Size: 792
User: 'LASF_Spec' - Description: 'RIEGL Extra Bytes'
ID: 4 Length: 576 Total Size: 630
Schema Summary
Point Format ID: 3
Number of dimensions: 16
Custom schema?: false
Size in bytes: 34
Dimensions
'X' -- size: 32 offset: 0
'Y' -- size: 32 offset: 4
'Z' -- size: 32 offset: 8
'Intensity' -- size: 16 offset: 12
'Return Number' -- size: 3 offset: 14
'Number of Returns' -- size: 3 offset: 14
'Scan Direction' -- size: 1 offset: 14
'Flightline Edge' -- size: 1 offset: 14
'Classification' -- size: 8 offset: 15
'Scan Angle Rank' -- size: 8 offset: 16
'User Data' -- size: 8 offset: 17
'Point Source ID' -- size: 16 offset: 18
'Time' -- size: 64 offset: 20
'Red' -- size: 16 offset: 28
'Green' -- size: 16 offset: 30
'Blue' -- size: 16 offset: 32
Point Inspection Summary
Header Point Count: 2023834
Actual Point Count: 2023834
Minimum and Maximum Attributes (min,max)
Min X, Y, Z: 465851.8133, 5060638.0048, 334.1078
Max X, Y, Z: 466398.7130, 5060851.2268, 374.3673
Bounding Box: 465851.8133, 5060638.0048, 466398.7130, 5060851.2268
Time: 313666.295394, 313691.616049
Return Number: 1, 6
Return Count: 1, 6
Flightline Edge: 0, 0
Intensity: 0, 54197
Scan Direction Flag: 1, 1
Scan Angle Rank: -43, 9
Classification: 2, 3
Point Source Id: 0, 0
User Data: 0, 0
Minimum Color (RGB): 0 1024 0
Maximum Color (RGB): 65280 65280 65280
Number of Points by Return
(1) 1505024 (2) 444251 (3) 69170 (4) 5187 (5) 201 (6) 1
Number of Returns by Pulse
(1) 1035210 (2) 762013 (3) 203503 (4) 21983 (5) 1115 (6) 10
Point Classifications
243759 Ground (2)
1780075 Low Vegetation (3)
0 withheld
0 keypoint
0 synthetic
`
I'd like to add that I'm able to read this las file with libLAS library without problems.
I hope these infos help identifying the problem.
Thank you for helping
pm
from pylas.
The problem comes from the fact that in the LAS header the point size is said to be 34 (the point size for a LAS with point format 3 and no extra bytes) but there is also an Extra bytes vlr present in the file:
lasinfo reports
variable length header record 5 of 5:
reserved 43707
user ID 'LASF_Spec'
record ID 4
length after header 576
description 'RIEGL Extra Bytes'
Extra Byte Descriptions
data type: 3 (unsigned short), name "Amplitude", description: "Echo signal amplitude [dB]", min: 0, max: 10000, scale: 0.01, offset: 0 (not set)
data type: 4 (short), name "Reflectance", description: "Echo signal reflectance [dB]", min: -5000, max: 15000, scale: 0.01, offset: 0 (not set)
data type: 3 (unsigned short), name "Deviation", description: "Pulse shape deviation", min: 0, max: 32767, scale: 1 (not set), offset: 0 (not set)
which brings the point_size to 40 bytes.
The files has 2_023_834 points and is 68_812_501 bytes on disk.
2_023_834 * 40 = 80,953,360 bytes
2_023_834 * 34 = 68,810,356 bytes
Do you expect the fields 'Amplitude', 'Reflectance', 'Deviation' to be in that particular file ?
from pylas.
Thank you very much for the explanation!
The fact is that I just need to read the points from the file; I don't need those fields (amplitude, reflectance, deviation) to be considered for the data extraction I'm going to do.
Is there a way to be able to get all the points anyway?
Thank you again,
pm
from pylas.
Well you can either reinstall pylas from github since i pushed a commit that fixes this, or wait for a new release.
or you could use lastools' las2las to remove the wrong vlr
las2las -remove_vlr 4 -i pointcloud.las -o pointcloud_without_extra_bytes_vlr.las
from pylas.
Wow, perfect! Thanks for the quick responses and fix :)
from pylas.
Related Issues (20)
- Piping LAS with extra bytes through laszip.exe to compress it produces bad files HOT 1
- Saving file after update_header HOT 3
- Uppercase extensions HOT 1
- More open modes HOT 1
- Improve/Fix Weird behaviour of sub fields
- EVLR support is clunky
- Improve EVLR handling
- Rework tests
- Handle Scaled Extra Bytes
- Regression: SubFieldView does not support some numpy operations HOT 1
- Helper to write SRS as WKT in VLR format HOT 2
- "lasrs" compression not working with current release in PyPi 0.4.3 HOT 2
- Seekable reader HOT 2
- Truncating return numbers HOT 6
- Write return value HOT 2
- remove dimension HOT 1
- Error when decompressing laz file HOT 2
- Converting Lidar .las / .laz to .tif
- Writing empty .LAZ makes python crash HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylas.