tmontaigu / pylas

⚠️ pylas was merged into laspy 2.0 https://github.com/laspy/laspy⚠️
BSD 3-Clause "New" or "Revised" License
39 stars 13 forks source link

Add Return Number to point attributes #1

Closed mccarthyryanc closed 6 years ago

mccarthyryanc commented 6 years ago

Thanks for this module! I love the laz-perf integration and streaming support! Would it be possible to add return_number to the point attributes?

For example lasinfo shows:

lasinfo -i pylastests/simple.laz
...
number of first returns:        925
number of intermediate returns: 28
number of last returns:         901
number of single returns:       789
overview over number of returns of given pulse: 789 195 71 10 0 0 0
...

However, with pylas:

python -c 'import pylas; print(pylas.open("pylastests/simple.laz").points.dtype.names)'

You only get:

('X', 'Y', 'Z', 'intensity', 'bit_fields', 'raw_classification', 'scan_angle_rank', 'user_data', 'point_source_id', 'gps_time', 'red', 'green', 'blue')
tmontaigu commented 6 years ago

I'm not sure if I understand correctly,

return_number is already accessible by doing

las = pylas.open('simple.las')
las.return_number

print(las.points_data.dimensions_names)
('X', 'Y', 'Z', 'intensity', 'return_number', 'number_of_returns', 'scan_direction_flag', 'edge_of_flight_line', 'classification', 'synthetic', 'key_point', 'withheld', 'scan_angle_rank', 'user_data', 'point_source_id', 'gps_time', 'red', 'green', 'blue')

return_number, number_of_returns, and other fields are 'hidden' in the bit_fields because the values are stored on less than a byte. Its the same for the raw_classification.

The number of returns that you show with lasinfo can be accessed with las.header.number_of_points_by_return

mccarthyryanc commented 6 years ago

You are totally right... that's what I get for rushing through my tests :tired_face:

tmontaigu commented 6 years ago

It's ok there is no docs 😗