~ubuntu-branches/ubuntu/trusty/liblas/trusty-proposed

« back to all changes in this revision

Viewing changes to doc/tutorial/vbnet.txt

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2014-01-05 17:00:29 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140105170029-ddtp0j63x5jvck2u
Tags: 1.7.0+dfsg-2
Fixed missing linking of system boost component.
(closes: #733282)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. _vbnet:
 
2
 
 
3
*********************************************
 
4
VB.NET Tutorial
 
5
*********************************************
 
6
 
 
7
This basic tutorial explains how to use libLAS to read and write 
 
8
LIDAR data encoded in LAS file format from VB.NET.
 
9
 
 
10
=============================================
 
11
Hello world
 
12
=============================================
 
13
 
 
14
.. code-block:: python
 
15
 
 
16
 Imports System
 
17
 Imports System.Text
 
18
 Imports LibLAS
 
19
 Class Program
 
20
        Private Shared Sub Main(args As String())
 
21
                Try
 
22
                        Dim lasreader As New LASReader("F:\sample_in.las")
 
23
                        Dim laspoint As LASPoint
 
24
                        Dim lasheader As LASHeader = lasreader.GetHeader()
 
25
                        Dim laswriter As New LASWriter("F:\sample_out.las", lasheader, LASReadWriteMode.LASModeWrite)
 
26
                        Console.WriteLine("Number of points in file= {0}", lasheader.PointRecordsCount)
 
27
                        While lasreader.GetNextPoint()
 
28
                                laspoint = lasreader.GetPoint()
 
29
                                'Console.WriteLine(laspoint.X + "," + laspoint.Y + "," + laspoint.Z);
 
30
                                laswriter.WritePoint(laspoint)
 
31
                        End While
 
32
                Catch e As LASException
 
33
                        Console.WriteLine("" & Chr(10) & "LASException! Msg: {0}", e.Message)
 
34
                Catch
 
35
                        Console.WriteLine("Unknown exception caught")
 
36
                Finally
 
37
                        Console.WriteLine("Do i need something to do?")
 
38
                End Try
 
39
                Console.WriteLine("End of file")
 
40
                Console.Read()
 
41
        End Sub
 
42
 End Class