From dc83627e5118363c7479ce166c6c26fec05a7c07 Mon Sep 17 00:00:00 2001 From: Ross King Date: Fri, 28 Aug 2026 09:25:19 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20incorrect=20GPS=20time=20value?= =?UTF-8?q?=20reading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/IO.Las/FieldAccessors.cs | 2 +- src/IO.Las/GpsColorWaveformPointDataRecord.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IO.Las/FieldAccessors.cs b/src/IO.Las/FieldAccessors.cs index 39df4a3..2224513 100644 --- a/src/IO.Las/FieldAccessors.cs +++ b/src/IO.Las/FieldAccessors.cs @@ -91,7 +91,7 @@ public static class PointDataRecord /// /// The data. /// The GPS time. - public static ushort GetGpsTime(ReadOnlySpan source) => System.Buffers.Binary.BinaryPrimitives.ReadUInt16LittleEndian(source[Constants.PointDataRecord.PointSourceIdFieldOffset..Constants.PointDataRecord.GpsTimeFieldOffset]); + public static double GetGpsTime(ReadOnlySpan source) => System.Buffers.Binary.BinaryPrimitives.ReadDoubleLittleEndian(source[Constants.PointDataRecord.GpsTimeFieldOffset..GpsPointDataRecord.Size]); /// /// Sets the GPS time. diff --git a/src/IO.Las/GpsColorWaveformPointDataRecord.cs b/src/IO.Las/GpsColorWaveformPointDataRecord.cs index 76741d4..c1dd53c 100644 --- a/src/IO.Las/GpsColorWaveformPointDataRecord.cs +++ b/src/IO.Las/GpsColorWaveformPointDataRecord.cs @@ -68,7 +68,7 @@ public GpsColorWaveformPointDataRecord(ReadOnlySpan data) this.ScanAngleRank = (sbyte)data[Constants.PointDataRecord.ScanAngleRankFieldOffset]; this.UserData = data[Constants.PointDataRecord.UserDataFieldOffset]; this.PointSourceId = FieldAccessors.PointDataRecord.GetPointSourceId(data); - this.GpsTime = System.Buffers.Binary.BinaryPrimitives.ReadDoubleLittleEndian(data[Constants.PointDataRecord.GpsTimeFieldOffset..Constants.PointDataRecord.GpsColorFieldOffset]); + this.GpsTime = FieldAccessors.PointDataRecord.GetGpsTime(data); this.Color = new() { R = System.Buffers.Binary.BinaryPrimitives.ReadUInt16LittleEndian(data[Constants.PointDataRecord.GpsColorFieldOffset..]),