From 408ab3895ac41bcf2efe76c1eb3593d35bc7fc03 Mon Sep 17 00:00:00 2001 From: Robert Schuldt Date: Sat, 9 Feb 2019 00:09:18 +0100 Subject: [PATCH] Fixed issue #8.2, wrong bit-masks caused classifications greater 7 to be wrongly stored in class laszip_point (and subsequently written out wrongly). --- LASreadItemCompressed_POINT14_v4.cs | 2 +- laszip_point.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LASreadItemCompressed_POINT14_v4.cs b/LASreadItemCompressed_POINT14_v4.cs index 60a284c..4d89a39 100644 --- a/LASreadItemCompressed_POINT14_v4.cs +++ b/LASreadItemCompressed_POINT14_v4.cs @@ -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 diff --git a/laszip_point.cs b/laszip_point.cs index 6db9472..86c8409 100644 --- a/laszip_point.cs +++ b/laszip_point.cs @@ -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;