Attribute VB_Name = "Module1" ' Code for the Riegl 2018 delivery ' LAS 1.2 Declare Function MYFUNC_ACOS Lib "c:\data\pascaldll.dll" (ByVal v1 As Double) As Double Declare Function MYFUNCLARGEFILE Lib "c:\data\ile.dll" (ByRef fname_in As Byte, ByVal startrec As Long, ByVal NumofRecs As Long, ByRef fname_out As Byte) As Long Declare Function MYFUNC_MASKING Lib "c:\data\pascaldll.dll" (ByRef Inp As Byte, ByRef Mask As Byte, ByRef Out As Byte) As Long Type HdrBlock ' 1.2 FileSign As String * 4 FileSource As Integer GlobalEncoding As Integer ID1 As Long ID2 As Integer ID3 As Integer ID4 As String * 8 VersionMajor As Byte VersionMinor As Byte SystemID As String * 32 Software As String * 32 c_Day As Integer c_Year As Integer HdrSize As Integer OffsetToData As Long NofVarLenRec As Long PointDataFormatId As Byte PointDataRecLen As Integer NumOfPointRec As Long NumOfPointSByReturn(1 To 5) As Long XScaleFactor As Double YScaleFactor As Double ZScaleFactor As Double XOffset As Double YOffset As Double ZOffset As Double MaxX As Double MinX As Double MaxY As Double MinY As Double MaxZ As Double MinZ As Double End Type Type VarLenRecHdr Reserved As Integer UserID As String * 16 RecordID As Integer RecLenAfterHdr As Integer Descriptio As String * 32 End Type Type LasPoint ' point format 1 in las1.2 X As Long Y As Long z As Long intensity As Integer PulseByte1 As Byte 'PulseByte2 As Byte class As Byte UserData As Byte ScanAngle As Byte ' Integer PointSourceID As Integer GPStime As Double End Type Type Vector3D X As Double Y As Double z As Double End Type Type point3D X As Double Y As Double z As Double End Type Rem 2006 ALTM 3100 pulse data, 207 bytes per record Type LidarRecord GPStime As Double PulseCount As Byte Returns(1 To 4) As point3D intensity(1 To 4) As Integer Range(1 To 4) As Double angle As Double Roll As Double pitch As Double heading As Double PosLiDAR As point3D StripNum As Integer SyncBit As Byte Res1 As Byte Res2 As Byte Res3 As Byte End Type Type Trajectory GPStime As Double X As Double Y As Double z As Double Roll As Double pitch As Double heading As Double End Type Public LiDR As LidarRecord Public Trj() As Trajectory Public Lpoint() As LasPoint Public Hdr As HdrBlock Type LASFile LASFileName As String TRJFilename As String NofPoints As Long End Type Public Function Stringlength(ByRef A As String) As Integer Dim i As Integer For i = 0 To 100 If (Mid$(A, i + 1, 1)) = "" Then Stringlength = i - 1 Exit Function End If Next i End Function