Rem ************************************ Rem Private Sub plot_als_bin_file_Click() Rem Rem For plotting (superimposing) lidar points in gray scale Rem Find the 1 ha BIN-file near the solution Dim FN1 As String * 3, FN2 As String * 3 FN1 = Format$(Int((X_sol - 2514000) / 100), "000") FN2 = Format$(Int((Y_sol - 6855000) / 100), "000") Open "D:\als2004\repros\bin\" & FN1 & "_" & FN2 & ".bin" For Binary As 1 Dim Np As Long, k As Long, i As Long Dim p_x As Double, p_y As Double Dim Apu_z As Byte Dim MeanSum As Double Get #1, 1, Np ' MsgBox ("Lidar points:" & Np) MeanSum = 0: Nin = 0 For k = 1 To Np Rem Read the point data, Xs, Ys, Zs (second pulse) Get #1, 5 + (k - 1) * 100, LP ll = LP.GPS_time ll = LP.Xl LP.Zs = LP.Zs + 0.18 ' difference at point 88M5041 LP.Zf = LP.Zf + 0.18 ' difference at point 88M5041 Rem Select points in a XY-rectangle If Abs(LP.Xs - X_sol) < 55.5 And Abs(LP.Ys - Y_sol) < 55.5 And Abs(LP.Xf - X_sol) < 55.5 And Abs(LP.Yf - Y_sol) < 55.5 Then Rem allow points with Z +- 40 m from current solution If Abs(LP.Zs - Z_sol) < 40 Then MeanSum = MeanSum + (Z_sol - LP.Zs) Nin = Nin + 1 For i = 0 To NumOfImages - 1 Rem Define color coding in gray scale from 185...227 m pu_z = 255 - (185 - LP.Zs) * 6 If pu_z > 255 Then pu_z = 255 If pu_z < 0 Then pu_z = 0 Apu_z = pu_z Form1.Picture1(i).DrawWidth = 3 Rem get image location of second (last pulse) Call r_transform_ground_to_pixel(i, LP.Xs, LP.Ys, CDbl(LP.Zs), p_x, p_y) Form1.Picture1(i).PSet ((p_x - (image_info(i).o_col + win_info(i).win_o_col)) * win_info(i).pan_x - 1, ((image_info(i).Height - 1) - p_y - (image_info(i).o_row + win_info(i).win_o_row)) * win_info(i).pan_y - 1), RGB(Apu_z, Apu_z, Apu_z) Rem Check that first pulse has a non-zero value If LP.Zf > 10 Then Rem Define color coding in gray scale from 185...227 m pu_z = 255 - (185 - LP.Zf) * 6 If pu_z > 255 Then pu_z = 255 If pu_z < 0 Then pu_z = 0 Apu_z = pu_z Rem get image location of first (last pulse) Call r_transform_ground_to_pixel(i, LP.Xf, LP.Yf, CDbl(LP.Zf), p_x, p_y) Form1.Picture1(i).PSet ((p_x - (image_info(i).o_col + win_info(i).win_o_col)) * win_info(i).pan_x - 1, ((image_info(i).Height - 1) - p_y - (image_info(i).o_row + win_info(i).win_o_row)) * win_info(i).pan_y - 1), RGB(Apu_z, Apu_z, Apu_z) End If Rem Return forecolor to white Form1.Picture1(i).ForeColor = RGB(255, 255, 255) Rem With dovents; plot point by point (slow) DoEvents Rem Section for printing elevations If LP.Zs > 130 Then Form1.Picture1(i).CurrentX = Form1.Picture1(i).CurrentX + Form1.Picture1(i).DrawWidth Form1.Picture1(i).Font = arial Form1.Picture1(i).ForeColor = RGB(255, 255, 0) Form1.Picture1(i).FontSize = 8 Form1.Picture1(i).FontBold = False ' Form1.Picture1(i).Print Format$(LP.Zs, "0.00") End If NextI: Next i ' Next image on the screen End If ' if clause for Z End If ' if clause for XY-rectangle Next k If Nin > 0 Then ' ff = InputBox(Format$(-MeanSum / Nin, "#.00 m"), "ll", X_sol & "," & Y_sol & "," & Format$(-MeanSum / Nin, "#.00 m")) End If Rem Close lidar binary file Close (1) End sub