[Liblas-commits] r1105 - trunk/python/liblas

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 17 12:55:08 EDT 2009


Author: hobu
Date: Tue Mar 17 12:55:04 2009
New Revision: 1105
URL: http://liblas.org/changeset/1105

Log:
complete #106, add descale/scale convenience methods to liblas.point

Modified:
   trunk/python/liblas/point.py

Modified: trunk/python/liblas/point.py
==============================================================================
--- trunk/python/liblas/point.py	(original)
+++ trunk/python/liblas/point.py	Tue Mar 17 12:55:04 2009
@@ -219,4 +219,14 @@
     
     def set_color(self, value):
         return core.las.LASPoint_SetColor(self.handle, value.handle)
-    color = property(get_color, set_color)
\ No newline at end of file
+    color = property(get_color, set_color)
+
+    def descale(self, header):
+        self.x = (self.x - header.offset[0]) / header.scale[0]
+        self.y = (self.y - header.offset[1]) / header.scale[1]
+        self.z = (self.y - header.offset[2]) / header.scale[2]
+    
+    def scale(self, header):
+        self.x = self.x + header.scale[0] + header.offset[0]
+        self.y = self.y + header.scale[1] + header.offset[1]
+        self.z = self.z + header.scale[2] + header.offset[2]


More information about the Liblas-commits mailing list