[Liblas-commits] r1109 - in trunk/python: liblas tests

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 17 13:19:51 EDT 2009


Author: hobu
Date: Tue Mar 17 13:19:48 2009
New Revision: 1109
URL: http://liblas.org/changeset/1109

Log:
Add VLR methods to srs object

Modified:
   trunk/python/liblas/core.py
   trunk/python/liblas/srs.py
   trunk/python/tests/SRS.txt

Modified: trunk/python/liblas/core.py
==============================================================================
--- trunk/python/liblas/core.py	(original)
+++ trunk/python/liblas/core.py	Tue Mar 17 13:19:48 2009
@@ -593,6 +593,13 @@
 las.LASSRS_AddVLR.errcheck = check_value
 las.LASSRS_AddVLR.restype = ctypes.c_int
 
+las.LASSRS_GetVLR.argtypes = [ctypes.c_void_p, ctypes.c_int]
+las.LASSRS_GetVLR.errcheck = check_void
+las.LASSRS_GetVLR.restype = ctypes.c_void_p
+
+las.LASSRS_GetVLRCount.argtypes = [ctypes.c_void_p]
+las.LASSRS_GetVLRCount.restype = ctypes.c_int
+
 las.LASHeader_GetSRS.argtypes = [ctypes.c_void_p]
 las.LASHeader_GetSRS.errcheck = check_void
 las.LASHeader_GetSRS.restype = ctypes.c_void_p

Modified: trunk/python/liblas/srs.py
==============================================================================
--- trunk/python/liblas/srs.py	(original)
+++ trunk/python/liblas/srs.py	Tue Mar 17 13:19:48 2009
@@ -68,24 +68,11 @@
         return core.las.LASSRS_SetProj4(self.handle, value)
     proj4 = property(get_proj4, set_proj4)
     
-    def add_vlr(self, vlr):
+    def AddVLR(self, vlr):
         return core.las.LASSRS_AddVLR(self.handle, vlr.handle)
+    
+    def GetVLR(self, value):
+        return vlr.VLR(handle=core.las.LASSRS_GetVLR(self.handle, value))
         
-    # def get_red(self):
-    #     return core.las.LASColor_GetRed(self.handle)
-    # def set_red(self, value):
-    #     return core.las.LASColor_SetRed(self.handle, value)
-    # red = property(get_red, set_red)
-    # 
-    # def get_green(self):
-    #     return core.las.LASColor_GetGreen(self.handle)
-    # def set_green(self, value):
-    #     return core.las.LASColor_SetGreen(self.handle, value)
-    # green = property(get_green, set_green)
-    # 
-    # def get_blue(self):
-    #     return core.las.LASColor_GetBlue(self.handle)
-    # def set_blue(self, value):
-    #     return core.las.LASColor_SetBlue(self.handle, value)
-    # blue = property(get_blue, set_blue)
-
+    def vlr_count(self):
+        return core.las.LASSRS_GetVLRCount(self.handle)

Modified: trunk/python/tests/SRS.txt
==============================================================================
--- trunk/python/tests/SRS.txt	(original)
+++ trunk/python/tests/SRS.txt	Tue Mar 17 13:19:48 2009
@@ -43,6 +43,8 @@
   ...         f.set_srs(s2)
   ...         p = f.read(0)
   ...         p.descale(f.header)
+  ...         if not s2.vlr_count() == 3: return False
+  ...         if not s2.GetVLR(0).recordlength == 64: return False
   ...         return int(round(p.x)) == -93  and int(round(p.y)) == 90
   ...     return False  
 


More information about the Liblas-commits mailing list