root/trunk/python/tests/Header.txt

Revision 947, 1.8 kB (checked in by hobu, 7 weeks ago)

more fixups related to #83.. ensure we use GMT and fix microseconds overflow

Line 
1 
2  >>> from liblas import header
3  >>> h = header.Header()
4
5  >>> h.dataformat_id
6  0
7
8  >>> h.scale
9  [0.01, 0.01, 0.01]
10
11  >>> h.min
12  [0.0, 0.0, 0.0]
13
14  >>> h.max
15  [0.0, 0.0, 0.0]
16
17  >>> h.offset
18  [0.0, 0.0, 0.0]
19
20  >>> h.major_version
21  1
22
23  >>> h.minor_version
24  1
25
26  >>> import datetime
27  >>> td = datetime.timedelta(hours=5) # my timezone is GMT-5
28  >>> now = datetime.datetime.now() - td
29  >>> today = datetime.datetime(now.year, now.month,now.day)
30 
31  >>> x = h.date - td
32  >>> d = datetime.datetime(x.year, x.month, x.day)
33  >>> d == today
34  True
35  >>> t = datetime.datetime(2008,3,19)
36  >>> h.date = t
37  >>> h.date
38  datetime.datetime(2008, 3, 19, 0, 0)
39
40  >>> h.software_id
41  'libLAS 1.0'
42  >>> h.software_id = 'hobu'
43  >>> h.software_id
44  'hobu'
45  >>> h.software_id = 'hobu'*9
46  >>> h.software_id
47  'hobuhobuhobuhobuhobuhobuhobuhob'
48 
49  >>> h.system_id
50  'libLAS'
51  >>> h.system_id = 'Python'
52  >>> h.system_id
53  'Python'
54
55  >>> h.max = [33452344.2333, 523442.344, -90.993]
56  >>> h.max
57  [33452344.2333, 523442.34399999998, -90.992999999999995]
58
59  >>> h.min = [33452344.2333, 523442.344, -90.993]
60  >>> h.min
61  [33452344.2333, 523442.34399999998, -90.992999999999995]
62
63  >>> h.offset = [32, 32, 256]
64  >>> h.offset
65  [32.0, 32.0, 256.0]
66 
67  >>> h.scale = [0.5, 0.5, 0.001]
68  >>> h.scale
69  [0.5, 0.5, 0.001]
70 
71  >>> h.point_return_count
72  [0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L]
73 
74  >>> h.point_return_count = [1341235L, 3412341222L, 0L, 0L, 4321L, 0L, 0L, 0L]
75  >>> h.point_return_count
76  [1341235L, 3412341222L, 0L, 0L, 4321L, 0L, 0L, 0L]
77 
78  >>> h.point_records_count
79  0L
80 
81  >>> h.point_records_count = 42
82  >>> h.point_records_count
83  42L
84 
85  >>> h.records_count
86  0L
87 
88  >>> h.header_size
89  227
90 
91  >>> h.proj4
92  ''
93  >>> h.proj4 = '+proj=utm +zone=17 +ellps=WGS84 +units=m'
94  >>> h.proj4
95  '+proj=utm +zone=17 +ellps=WGS84 +units=m'
Note: See TracBrowser for help on using the browser.