when reading in uint16s it appear to be reading them in backwards as all of the numbers I am getting seem to be bit shifted 8 to the left instead of where they should be. Maybe I am doing something wrong. Here is the code I am testing it on.
when I try manually parsing the code I am able to get correct numbers but the numbers I am getting from the generated parser are wrong. for ID the value should be 101 but i am getting 25856 instead. I can share the manual parser if that is needed. Thank you
This is because binaryparse is strictly big endian, and that specification says numbers are in little endian. Simply do an endianess swap with the endians module and you should get the values you expect.
when reading in uint16s it appear to be reading them in backwards as all of the numbers I am getting seem to be bit shifted 8 to the left instead of where they should be. Maybe I am doing something wrong. Here is the code I am testing it on.
https://www.asprs.org/wp-content/uploads/2010/12/LAS_1_4_r13.pdf is the specifications for parsing. and the dataset I am testing it on can be found here https://figshare.com/articles/dataset/NEON_Teaching_Data_LiDAR_Point_Cloud_las_Data/4307750
when I try manually parsing the code I am able to get correct numbers but the numbers I am getting from the generated parser are wrong. for ID the value should be 101 but i am getting 25856 instead. I can share the manual parser if that is needed. Thank you