[Liblas-commits] hg: tweak reading
liblas-commits at liblas.org
liblas-commits at liblas.org
Mon Oct 19 15:23:09 EDT 2009
changeset 7f1aaecce916 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=7f1aaecce916
summary: tweak reading
diffstat:
python/scripts/oci2las.py | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (42 lines):
diff -r 4539ed747928 -r 7f1aaecce916 python/scripts/oci2las.py
--- a/python/scripts/oci2las.py Mon Oct 19 13:14:34 2009 -0500
+++ b/python/scripts/oci2las.py Mon Oct 19 14:20:23 2009 -0500
@@ -124,13 +124,12 @@
return False
- def get_points(self, num_points, block_blob):
+ def get_points(self, num_points, blob):
points = []
- num, blk = num_points,block_blob
- data = blk.read()
- for i in xrange(num):
+
+ for i in xrange(num_points):
rng = ptsize*i,ptsize*(i+1)
- d = struct.unpack(format,data[ptsize*i:ptsize*(i+1)])
+ d = struct.unpack(format,blob[ptsize*i:ptsize*(i+1)])
x, y, z, blk_id, pt_id = d
p = point.Point()
p.x = x; p.y = y; p.z = z
@@ -219,7 +218,8 @@
blocks = self.cur.fetchall()
for block in blocks:
- points.append(self.get_points(*block))
+ num_points, blob = block[0], block[1].read()
+ points.append(self.get_points(num_points,blob))
num_pts_index, blob_index = self.get_block_indexes(self.cur)
@@ -228,8 +228,8 @@
if not clouds:
for row in res:
num_points = row[num_pts_index]
- block_blob = row[blob_index]
- points.append(self.get_points(num_points, block_blob))
+ blob = row[blob_index].read()
+ points.append(self.get_points(num_points, blob))
self.output = self.open_output()
More information about the Liblas-commits
mailing list