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

« back to all changes in this revision

Viewing changes to doc/tutorial/csharp.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
.. _csharp_tutorial:
 
2
 
 
3
*********************************************
 
4
C# 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 C#.
 
9
 
 
10
=============================================
 
11
Hello world
 
12
=============================================
 
13
 
 
14
.. code-block:: cpp
 
15
 
 
16
 using System;
 
17
 using System.Text;
 
18
 using LibLAS;
 
19
 
 
20
 class Program
 
21
 {
 
22
    static void Main(string[] args)
 
23
 
 
24
    {
 
25
        try
 
26
        {
 
27
            LASReader lasreader = new LASReader(@"F:\sample_in.las");
 
28
            LASPoint laspoint;
 
29
            LASHeader lasheader = lasreader.GetHeader();
 
30
            LASWriter laswriter = new LASWriter(@"F:\sample_out.las", lasheader, LASReadWriteMode.LASModeWrite);
 
31
            Console.WriteLine("Number of points in file= {0}", lasheader.PointRecordsCount);
 
32
 
 
33
            while (lasreader.GetNextPoint())
 
34
            {
 
35
                laspoint = lasreader.GetPoint();
 
36
                //Console.WriteLine(laspoint.X + "," + laspoint.Y + "," + laspoint.Z);
 
37
                laswriter.WritePoint(laspoint);
 
38
            }
 
39
        }
 
40
        catch (LASException e)
 
41
        {
 
42
            Console.WriteLine("\nLASException! Msg: {0}", e.Message);
 
43
        }
 
44
        catch
 
45
        {
 
46
            Console.WriteLine("Unknown exception caught");
 
47
        }
 
48
        finally
 
49
        {
 
50
            Console.WriteLine("Do i need something to do?");
 
51
        }
 
52
 
 
53
        Console.WriteLine("End of file");
 
54
        Console.Read();
 
55
    }
 
56
 }
 
 
b'\\ No newline at end of file'