  >>> from liblas import vlr
  >>> v = vlr.VLR()
  >>> v.reserved
  43707
  >>> v.recordid
  0
  >>> v.recordid = 2
  >>> v.recordid
  2
  >>> v.userid
  ''
  >>> v.userid = 'liblas.org'
  >>> v.userid
  'liblas.org'
  
  >>> v.description
  ''
  >>> v.description = 'libLAS'
  >>> v.description
  'libLAS'
  
  >>> v.recordlength = 256
  >>> v.recordlength 
  256
  
  >>> import ctypes
  >>> data = (ctypes.c_ubyte * 256)()
  >>> data[10]
  0
  
  >>> for i in range(256):
  ...     data[i] = 2+i
  
  >>> data[10]
  12
  >>> v.data = data
  
# Ensure we can round trip the data
  >>> [data[i] for i in range(10)]
  [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  >>> [v.data[i] for i in range(10)]
  [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

# Ensure poking one array doesn't affect the other
  >>> data[1] = 32
  >>> v.data = data
  >>> data[1] = 3
  >>> v.data[1]
  32
  >>> data[1]
  3
  
  >>> [v.data[i] for i in range(10)]
  [2, 32, 4, 5, 6, 7, 8, 9, 10, 11]
  
  >>> import liblas

#  >>> liblas.HAVE_GDAL
#  >>> liblas.HAVE_LIBGEOTIFF

  >>> from liblas import file
  >>> f = file.File('../test/data/srs.las')
  >>> h = f.header
  >>> h.records_count
  3L
 
  >>> def test_srs():
  ...     s = h.srs
  ...     if not liblas.HAVE_LIBGEOTIFF:
  ...         return True
  ...     if not liblas.HAVE_GDAL: 
  ...         return s.proj4 == '+proj=utm +zone=17 +ellps=WGS84 +units=m '
  ...     if liblas.HAVE_GDAL:
  ...         return s.proj4 == '+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs '
  ...     return False
  
  >>> test_srs()
  True
  
  
  >>> v = h.GetVLR(0)
  >>> v.recordid
  34735
  >>> v.userid
  'LASF_Projection'
  
  >>> data = v.data
  >>> len(data)
  72
  >>> data[6]
  8

  # Deleting a VLR shouldn't change the offset
  >>> h.data_offset
  759L
  >>> h.DeleteVLR(0)
  >>> h.data_offset
  759L
  
  >>> del f
  
  >>> f = file.File('../test/data/srs.las')
  >>> h = f.header
  >>> f.header.data_offset
  759L
  >>> f2 = file.File('junk_srs.las',mode='w',header=h)
  >>> for p in f:
  ...     f2.write(p)
  
  >>> f2.close()
  >>> del f2
  
  >>> f3 = file.File('junk_srs.las')
  >>> f3.header.records_count
  3L
  >>> f3.header.data_offset
  759L
  >>> import os
  >>> os.remove('junk_srs.las')

