Skip to content

Commit

Permalink
Fixed issue #8.2, wrong bit-masks caused classifications greater 7 to…
Browse files Browse the repository at this point in the history
… be wrongly stored in class laszip_point (and subsequently written out wrongly).
  • Loading branch information
shintadono committed Feb 8, 2019
1 parent bf17f72 commit 408ab38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LASreadItemCompressed_POINT14_v4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public override void read(laszip_point item, ref uint context) // context is set
var last_item = contexts[current_context].last_item;

////////////////////////////////////////
// decompress returns_XY layer
// decompress returns_XY layer
////////////////////////////////////////

// create single (3) / first (1) / last (2) / intermediate (0) context from last point return
Expand Down
2 changes: 1 addition & 1 deletion laszip_point.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class laszip_point
public byte edge_of_flight_line { get { return (byte)((flags >> 7) & 1); } set { flags = (byte)((flags & 0x7F) | ((value & 1) << 7)); } }
internal byte flags;
//public byte classification : 5;
public byte classification { get { return (byte)(classification_and_classification_flags & 31); } set { classification_and_classification_flags = (byte)((classification_and_classification_flags & 0xF8) | (value & 7)); } }
public byte classification { get { return (byte)(classification_and_classification_flags & 31); } set { classification_and_classification_flags = (byte)((classification_and_classification_flags & 0xE0) | (value & 31)); } }
//public byte synthetic_flag : 1;
public byte synthetic_flag { get { return (byte)((classification_and_classification_flags >> 5) & 1); } set { flags = (byte)((classification_and_classification_flags & 0xDF) | ((value & 1) << 5)); } }
//public byte keypoint_flag : 1;
Expand Down

0 comments on commit 408ab38

Please sign in to comment.