[GRASS-SVN] r58627 - grass/trunk/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 6 09:54:24 PST 2014


Author: zarch
Date: 2014-01-06 09:54:24 -0800 (Mon, 06 Jan 2014)
New Revision: 58627

Modified:
   grass/trunk/lib/python/pygrass/vector/find.py
Log:
Add additional parameters to reduce the memory foot print during a cicle

Modified: grass/trunk/lib/python/pygrass/vector/find.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/find.py	2014-01-06 17:50:26 UTC (rev 58626)
+++ grass/trunk/lib/python/pygrass/vector/find.py	2014-01-06 17:54:24 UTC (rev 58627)
@@ -159,17 +159,17 @@
                             table=self.table, writable=self.writable)
 
     @must_be_open
-    def areas(self, bbox, bbox_list=False):
+    def areas(self, bbox, boxlist=None, bboxlist_only=False):
         """Find the nearest area. Vect_find_area"""
-        found = BoxList()
+        boxlist = boxlist if boxlist else BoxList()
         if libvect.Vect_select_areas_by_box(self.c_mapinfo, bbox.c_bbox,
-                                            found.c_boxlist):
-            if bbox_list:
-                return found
+                                            boxlist.c_boxlist):
+            if bboxlist_only:
+                return boxlist
             else:
                 return (Area(v_id=a_id, c_mapinfo=self.c_mapinfo,
                              table=self.table, writable=self.writable)
-                        for a_id in found.ids)
+                        for a_id in boxlist.ids)
         return []
 
     @must_be_open



More information about the grass-commit mailing list