diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e26440a9..5d022502 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +### 5.5.2 +- [e57] fixed parsing fix (cherrypicked from v53 branch) + ### 5.5.1 - [e57] fix parsing of classifications that would be encoded with 0 bits per value (see e57 spec 9.7.4.2 (3)) diff --git a/src/Aardvark.Algodat.Tests/Program.cs b/src/Aardvark.Algodat.Tests/Program.cs index 721cbfcc..1fd09197 100644 --- a/src/Aardvark.Algodat.Tests/Program.cs +++ b/src/Aardvark.Algodat.Tests/Program.cs @@ -2792,7 +2792,14 @@ static void Test_Parse_Regression() var basedir = @"W:\Datasets\pointclouds\tests"; foreach (var file in Directory.GetFiles(basedir, "*.e57")) { - ParsePointCloudFile(file, verbose: false); + try + { + ParsePointCloudFile(file, verbose: false); + } + catch (Exception e) + { + WriteLine(e); + } } } @@ -2800,12 +2807,16 @@ public static async Task Main(string[] _) { await Task.CompletedTask; // avoid warning if no async methods are called here ... + Test_Parse_Regression(); + //Test_Import_Regression(); - ParsePointCloudFile(@"E:\Villa Vaduz gesamt.e57", verbose: false); - //ParsePointCloudFile(@"W:\Datasets\pointclouds\tests\KOE1 OG7.e57", verbose: false); + //ParsePointCloudFile( + // @"E:\Villa Vaduz gesamt.e57", + // //@"W:\Datasets\pointclouds\tests\6562-alle-Scans.e57", + // verbose: false + // ); - //Test_Parse_Regression(); //await CreateStore( // @"E:\Villa Vaduz gesamt.e57", diff --git a/src/Aardvark.Data.E57/ASTM_E57.cs b/src/Aardvark.Data.E57/ASTM_E57.cs index 88505a9d..11d8783a 100644 --- a/src/Aardvark.Data.E57/ASTM_E57.cs +++ b/src/Aardvark.Data.E57/ASTM_E57.cs @@ -1326,11 +1326,36 @@ ImmutableHashSet exclude if (prototype is E57Integer x0 && x0.NumberOfBitsForBitPack == 0) { - if (semantic == PointPropertySemantics.Classification) + if ( + semantic == PointPropertySemantics.CartesianInvalidState || + semantic == PointPropertySemantics.Classification || + semantic == PointPropertySemantics.ColumnIndex || + semantic == PointPropertySemantics.IsColorInvalid || + semantic == PointPropertySemantics.IsIntensityInvalid || + semantic == PointPropertySemantics.IsTimeStampInvalid || + semantic == PointPropertySemantics.ReturnCount || + semantic == PointPropertySemantics.ReturnIndex || + semantic == PointPropertySemantics.RowIndex || + semantic == PointPropertySemantics.SphericalInvalidState + ) { if (x0.Value >= int.MinValue && x0.Value <= int.MaxValue) { - chunk = chunk.Add(PointPropertySemantics.Classification, new int[ps.Length].Set((int)x0.Value)); + var xs = new int[ps.Length].Set((int)x0.Value); + chunk = semantic switch + { + PointPropertySemantics.CartesianInvalidState => chunk.Add(PointPropertySemantics.CartesianInvalidState , xs), + PointPropertySemantics.Classification => chunk.Add(PointPropertySemantics.Classification , xs), + PointPropertySemantics.ColumnIndex => chunk.Add(PointPropertySemantics.ColumnIndex , xs), + PointPropertySemantics.IsColorInvalid => chunk.Add(PointPropertySemantics.IsColorInvalid , xs), + PointPropertySemantics.IsIntensityInvalid => chunk.Add(PointPropertySemantics.IsIntensityInvalid , xs), + PointPropertySemantics.IsTimeStampInvalid => chunk.Add(PointPropertySemantics.IsTimeStampInvalid , xs), + PointPropertySemantics.ReturnCount => chunk.Add(PointPropertySemantics.ReturnCount , xs), + PointPropertySemantics.ReturnIndex => chunk.Add(PointPropertySemantics.ReturnIndex , xs), + PointPropertySemantics.RowIndex => chunk.Add(PointPropertySemantics.RowIndex , xs), + PointPropertySemantics.SphericalInvalidState => chunk.Add(PointPropertySemantics.SphericalInvalidState , xs), + _ => throw new Exception($"Semantic {semantic} with 0 bits per value not supported. Error 81cbccee-1147-4695-82e5-54a3d05bf118.") + }; } else {