Skip to content

Commit 96d99e1

Browse files
add project Unofficial.laszip.netstandard (cointaining latest snapshot of devel branch of https://github.com/shintadono/laszip.net which supposedly supports laszip 1.4)
1 parent be5641d commit 96d99e1

File tree

6 files changed

+39
-37
lines changed

6 files changed

+39
-37
lines changed

paket.dependencies

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ nuget NUnit3TestAdapter ~> 4.2.1
3838
nuget Uncodium.Eigensystems ~> 1.1.2
3939
nuget Uncodium.SimpleStore ~> 3.0.14
4040
nuget Unofficial.DotSpatial.Projections ~> 0.0.4
41-
nuget Unofficial.laszip.netstandard ~> 2.2.1
4241

4342
nuget sharpcompress ~> 0.30.0 // only used in Apps/heracli
4443

paket.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ NUGET
360360
System.Threading (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== net6.0) (== netstandard2.0)
361361
System.Memory (4.5.5)
362362
System.Buffers (>= 4.5.1) - restriction: || (== net472) (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
363-
System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net472) (== net6.0)) (&& (== net472) (< net45)) (&& (== net6.0) (< netcoreapp2.0)) (== netstandard2.0)
363+
System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net472) (< net45)) (&& (== net6.0) (< netcoreapp2.0)) (== netstandard2.0)
364364
System.Numerics.Vectors (>= 4.5) - restriction: || (== net472) (&& (== net6.0) (>= net461)) (&& (== netstandard2.0) (>= net461))
365365
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (== net472) (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
366366
System.Numerics.Vectors (4.5)
@@ -377,10 +377,10 @@ NUGET
377377
System.Reflection.Primitives (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== net6.0) (== netstandard2.0)
378378
System.Runtime (>= 4.3) - restriction: || (&& (== net472) (< net45)) (== net6.0) (== netstandard2.0)
379379
System.Reflection.Emit (4.7) - restriction: || (&& (== net472) (< net45)) (== net6.0) (== netstandard2.0)
380-
System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net472) (== net6.0)) (&& (== net472) (< net45)) (&& (== net472) (< netstandard1.1)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (>= uap10.1)) (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
380+
System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard1.1)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (>= uap10.1)) (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
381381
System.Reflection.Emit.ILGeneration (4.7) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (< portable-net45+wp8)) (&& (== net472) (>= uap10.1)) (== net6.0) (== netstandard2.0)
382382
System.Reflection.Emit.Lightweight (4.7)
383-
System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net472) (== net6.0)) (&& (== net472) (< net45)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (< portable-net45+wp8)) (&& (== net472) (>= uap10.1)) (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (< portable-net45+wp8)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
383+
System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net472) (< net45)) (&& (== net472) (< netstandard2.0) (>= wpa81)) (&& (== net472) (< portable-net45+wp8)) (&& (== net472) (>= uap10.1)) (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (< portable-net45+wp8)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
384384
System.Reflection.Extensions (4.3) - restriction: || (&& (== net472) (< net45)) (== net6.0) (== netstandard2.0)
385385
Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== net6.0) (== netstandard2.0)
386386
Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (== net472) (< net45)) (== net6.0) (== netstandard2.0)
@@ -445,7 +445,6 @@ NUGET
445445
Microsoft.Bcl.AsyncInterfaces (>= 6.0 < 6.1)
446446
System.Memory (>= 4.5.5 < 4.6)
447447
Unofficial.DotSpatial.Projections (0.0.4)
448-
Unofficial.laszip.netstandard (2.2.1)
449448
Unofficial.LibTessDotNet (2.0.2)
450449
Unofficial.OpenTK (3.0.20)
451450
Unofficial.OpenVR (1.1)

src/Aardvark.Algodat.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aardvark.Data.Points.Ply",
7474
EndProject
7575
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aardvark.Data.Wavefront", "Aardvark.Data.Wavefront\Aardvark.Data.Wavefront.csproj", "{7C25100A-8774-422C-90FB-FA113F798CB4}"
7676
EndProject
77+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unofficial.laszip.netstandard", "Unofficial.laszip.netstandard\Unofficial.laszip.netstandard.csproj", "{AC84C458-5A8A-4EC9-A1B3-15CC52DA2E91}"
78+
EndProject
7779
Global
7880
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7981
Debug|Any CPU = Debug|Any CPU
@@ -180,6 +182,10 @@ Global
180182
{7C25100A-8774-422C-90FB-FA113F798CB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
181183
{7C25100A-8774-422C-90FB-FA113F798CB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
182184
{7C25100A-8774-422C-90FB-FA113F798CB4}.Release|Any CPU.Build.0 = Release|Any CPU
185+
{AC84C458-5A8A-4EC9-A1B3-15CC52DA2E91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
186+
{AC84C458-5A8A-4EC9-A1B3-15CC52DA2E91}.Debug|Any CPU.Build.0 = Debug|Any CPU
187+
{AC84C458-5A8A-4EC9-A1B3-15CC52DA2E91}.Release|Any CPU.ActiveCfg = Release|Any CPU
188+
{AC84C458-5A8A-4EC9-A1B3-15CC52DA2E91}.Release|Any CPU.Build.0 = Release|Any CPU
183189
EndGlobalSection
184190
GlobalSection(SolutionProperties) = preSolution
185191
HideSolutionNode = FALSE
@@ -193,7 +199,7 @@ Global
193199
{5CA8E4F4-E30B-4FC8-A510-A0FFD8A9880B} = {6CA9BC7A-0123-43E9-A26B-5FF0B9E01B08}
194200
EndGlobalSection
195201
GlobalSection(ExtensibilityGlobals) = postSolution
196-
EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8;packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45
197202
SolutionGuid = {E996B5E6-49B2-4479-9DDE-455A40509F43}
203+
EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8;packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45
198204
EndGlobalSection
199205
EndGlobal

src/Aardvark.Data.Points.LasZip/Aardvark.Data.Points.LasZip.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
</PropertyGroup>
1414
<ItemGroup>
1515
<ProjectReference Include="..\Aardvark.Data.Points.Base\Aardvark.Data.Points.Base.csproj" />
16+
<ProjectReference Include="..\Unofficial.laszip.netstandard\Unofficial.laszip.netstandard.csproj" />
1617
</ItemGroup>
1718
<Import Project="..\..\.paket\Paket.Restore.targets" />
1819
</Project>

src/Aardvark.Data.Points.LasZip/Parser.cs

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2017-2021. Stefan Maierhofer.
2+
Copyright (C) 2017-2022. Stefan Maierhofer.
33
44
This code has been COPIED from https://github.com/stefanmaierhofer/LASzip.
55
@@ -16,7 +16,7 @@ You may obtain a copy of the License at
1616
limitations under the License.
1717
*/
1818
using Aardvark.Base;
19-
using laszip.net;
19+
using LASzip.Net;
2020
using System;
2121
using System.Collections;
2222
using System.Collections.Generic;
@@ -92,9 +92,8 @@ public static class Parser
9292
/// </summary>
9393
public static Info ReadInfo(string filename)
9494
{
95-
var reader = new laszip_dll();
96-
var compressed = false;
97-
reader.laszip_open_reader(filename, ref compressed);
95+
var reader = new laszip();
96+
reader.open_reader(filename, out _);
9897
return ReadInfo(reader);
9998
}
10099

@@ -103,13 +102,12 @@ public static Info ReadInfo(string filename)
103102
/// </summary>
104103
public static Info ReadInfo(Stream stream)
105104
{
106-
var reader = new laszip_dll();
107-
var compressed = false;
108-
reader.laszip_open_reader(stream, ref compressed);
105+
var reader = new laszip();
106+
reader.open_reader_stream(stream, out _);
109107
return ReadInfo(reader);
110108
}
111109

112-
private static Info ReadInfo(laszip_dll reader)
110+
private static Info ReadInfo(laszip reader)
113111
{
114112
var count = reader.header.number_of_point_records;
115113

@@ -124,7 +122,7 @@ private static Info ReadInfo(laszip_dll reader)
124122
reader.header.max_z)
125123
);
126124

127-
reader.laszip_close_reader();
125+
reader.close_reader();
128126

129127
return new Info(count, bounds);
130128
}
@@ -136,9 +134,8 @@ private static Info ReadInfo(laszip_dll reader)
136134
/// </summary>
137135
public static IEnumerable<Points> ReadPoints(string filename, int numberOfPointsPerChunk, bool verbose)
138136
{
139-
var reader = new laszip_dll();
140-
var isCompressed = false;
141-
reader.laszip_open_reader(filename, ref isCompressed);
137+
var reader = new laszip();
138+
reader.open_reader(filename, out _);
142139
return ReadPoints(reader, numberOfPointsPerChunk, verbose);
143140
}
144141
/// <summary>
@@ -152,9 +149,8 @@ public static IEnumerable<Points> ReadPoints(string filename, int numberOfPoints
152149
/// </summary>
153150
public static IEnumerable<Points> ReadPoints(Stream stream, int numberOfPointsPerChunk, bool verbose)
154151
{
155-
var reader = new laszip_dll();
156-
var isCompressed = false;
157-
reader.laszip_open_reader(stream, ref isCompressed);
152+
var reader = new laszip();
153+
reader.open_reader_stream(stream, out _);
158154
return ReadPoints(reader, numberOfPointsPerChunk, verbose);
159155
}
160156
/// <summary>
@@ -163,19 +159,21 @@ public static IEnumerable<Points> ReadPoints(Stream stream, int numberOfPointsPe
163159
public static IEnumerable<Points> ReadPoints(Stream stream, int numberOfPointsPerChunk)
164160
=> ReadPoints(stream, numberOfPointsPerChunk, verbose: false);
165161

166-
private static IEnumerable<Points> ReadPoints(laszip_dll reader, int numberOfPointsPerChunk, bool verbose)
162+
private static IEnumerable<Points> ReadPoints(laszip reader, int numberOfPointsPerChunk, bool verbose)
167163
{
168-
var n = reader.header.number_of_point_records;
169-
//var numberOfChunks = n / numberOfPointsPerChunk;
164+
if (numberOfPointsPerChunk < 1) throw new ArgumentOutOfRangeException(nameof(numberOfPointsPerChunk));
170165

171-
var format = reader.header.point_data_format;
172-
var hasGpsTime = format == 1 || format == 3 || format == 4 || format == 5;
173-
var hasColor = format == 2 || format == 3 || format == 5;
174-
var hasWavePacket = format == 4 || format == 5;
166+
ulong n = reader.header.number_of_point_records;
167+
if (n == 0) n = reader.header.extended_number_of_point_records;
175168

176-
for (var j = 0; j < n; j += numberOfPointsPerChunk)
169+
var f = reader.header.point_data_format;
170+
var hasGpsTime = f == 1 || f == 3 || f == 4 || f == 5 || f == 6 || f == 7 || f == 8 || f == 9 || f == 10;
171+
var hasColor = f == 2 || f == 3 || f == 5 || f == 7 || f == 8 || f == 10;
172+
var hasWavePacket = f == 4 || f == 5 || f == 9 || f == 10;
173+
174+
for (var j = 0ul; j < n; j += (uint)numberOfPointsPerChunk)
177175
{
178-
if (j + numberOfPointsPerChunk > n) numberOfPointsPerChunk = (int)(n - j);
176+
if (j + (uint)numberOfPointsPerChunk > n) numberOfPointsPerChunk = (int)(n - j);
179177
if (verbose) Console.WriteLine($"j: {j}, numberOfPointsPerChunk: {numberOfPointsPerChunk}, n: {n}");
180178

181179
// POINT10
@@ -209,13 +207,13 @@ private static IEnumerable<Points> ReadPoints(laszip_dll reader, int numberOfPoi
209207

210208
for (var i = 0; i < numberOfPointsPerChunk; i++)
211209
{
212-
reader.laszip_read_point();
210+
reader.read_point();
213211

214-
reader.laszip_get_coordinates(p);
212+
reader.get_coordinates(p);
215213
ps[i] = new V3d(p);
216214
intensities[i] = reader.point.intensity;
217215
returnNumbers[i] = reader.point.return_number;
218-
numberOfReturnsOfPulses[i] = reader.point.number_of_returns_of_given_pulse;
216+
numberOfReturnsOfPulses[i] = Math.Max(reader.point.number_of_returns, reader.point.extended_number_of_returns);
219217
scanDirectionFlags[i] = reader.point.scan_direction_flag != 0;
220218
edgeOfFlightLines[i] = reader.point.edge_of_flight_line != 0;
221219
classifications[i] = reader.point.classification;
@@ -300,7 +298,7 @@ private static IEnumerable<Points> ReadPoints(laszip_dll reader, int numberOfPoi
300298
};
301299
}
302300

303-
reader.laszip_close_reader();
301+
reader.close_reader();
304302
}
305303
}
306304
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Aardvark.Base
2-
Unofficial.laszip.netstandard
1+
Aardvark.Base

0 commit comments

Comments
 (0)