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

« back to all changes in this revision

Viewing changes to csharp/Samples/WriteLAS/WriteLAS.cs

  • 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
using System;
 
2
using System.Collections.Generic;
 
3
using System.Text;
 
4
using LibLAS;
 
5
using System.IO;
 
6
 
 
7
 
 
8
namespace WriteLAS
 
9
{
 
10
    public class WriteLAS
 
11
    {
 
12
        static void Main(string[] args)
 
13
        {
 
14
            try
 
15
            {
 
16
 
 
17
                string filename = @".\test.las";
 
18
                LASHeader hdr = new LASHeader();
 
19
                hdr.VersionMajor = 1;
 
20
                hdr.VersionMinor = 1;
 
21
                hdr.DataFormatId = (byte)LASHeader.PointFormat.ePointFormat1;
 
22
                hdr.PointRecordsCount = 1000; // should be corrected automatically by writer
 
23
                LASWriter laswriter = new LASWriter(filename, hdr, LASReadWriteMode.LASModeWrite);
 
24
                LASPoint p=new LASPoint();
 
25
                p.X = 10;
 
26
                p.Y = 20;
 
27
                p.Z = 30;
 
28
                laswriter.WritePoint(p);
 
29
                //File.Delete(filename);
 
30
 
 
31
            }
 
32
            catch (LASException e)
 
33
            {
 
34
                Console.WriteLine("\nLASException! Msg: {0}", e.Message);
 
35
            }
 
36
            catch (SystemException e)
 
37
            {
 
38
                Console.WriteLine("\nException! Msg: {0}", e.Message);
 
39
            }
 
40
            catch
 
41
            {
 
42
                Console.WriteLine("Unknown exception caught");
 
43
            }
 
44
 
 
45
            Console.WriteLine("End of file");
 
46
            Console.Read();
 
47
        }
 
48
 
 
49
    }
 
50
}