File: add_vlr.py

package info (click to toggle)
liblas 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,888 kB
  • ctags: 4,614
  • sloc: cpp: 31,630; xml: 4,195; python: 2,928; ansic: 2,439; cs: 2,411; sh: 143; makefile: 37
file content (25 lines) | stat: -rwxr-xr-x 434 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from liblas import file as lasfile
from liblas import vlr
from liblas import header as lasheader

f = lasfile.File('test/data/srs_utm17.las',None,'rb')
h = f.header

v = vlr.VLR()

text =  open('schemas/las.xml','rb').read()

import ctypes

data = ctypes.create_string_buffer(text)

v.userid='hobu'
v.recordid = 12345
v.data = data

h.add_vlr(v)

f2 = lasfile.File('junk.las',header=h,mode='w')
for p in f:
    f2.write(p)
f2.close()