Package python :: Module geo_reader
[hide private]
[frames] | no frames]

Source Code for Module python.geo_reader

 1  from encoder import decode_unsigned 
 2  from encoder import decode_float 
 3  import sys 
 4   
 5  FLOAT_SIZE = 8 
 6  INT_SIZE = 4 
 7  LONG_SIZE = 8 
 8   
9 -def read(file_handle):
10 geo = dict() 11 12 while True : 13 14 data = file_handle.read( INT_SIZE ) 15 if data == "" : 16 return geo 17 18 string = decode_unsigned( data ) 19 om =decode_unsigned( file_handle.read( INT_SIZE ) ) 20 x = decode_float( file_handle.read( FLOAT_SIZE ) ) 21 y = decode_float( file_handle.read( FLOAT_SIZE ) ) 22 z = decode_float( file_handle.read( FLOAT_SIZE ) ) 23 24 geo[(string,om)] = (x,y,z)
25