[GRASS-SVN] r55945 - grass/trunk/lib/python/pygrass/vector
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Apr 22 08:48:44 PDT 2013
Author: zarch
Date: 2013-04-22 08:48:44 -0700 (Mon, 22 Apr 2013)
New Revision: 55945
Modified:
grass/trunk/lib/python/pygrass/vector/__init__.py
Log:
Fix if set_cats is True reset the previous cat values and set the new one.
Modified: grass/trunk/lib/python/pygrass/vector/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/__init__.py 2013-04-22 15:31:32 UTC (rev 55944)
+++ grass/trunk/lib/python/pygrass/vector/__init__.py 2013-04-22 15:48:44 UTC (rev 55945)
@@ -15,7 +15,7 @@
from geometry import GEOOBJ as _GEOOBJ
from geometry import read_line, read_next_line
from abstract import Info
-from basic import Bbox
+from basic import Bbox, Cats
_NUMOF = {"areas": libvect.Vect_get_num_areas,
@@ -183,7 +183,9 @@
cur.close()
if set_cats:
- libvect.Vect_cat_set(geo_obj.c_cats, self.layer, self.n_lines)
+ cats = Cats(geo_obj.c_cats)
+ cats.reset()
+ cats.set(self.n_lines, self.layer)
result = libvect.Vect_write_line(self.c_mapinfo, geo_obj.gtype,
geo_obj.c_points, geo_obj.c_cats)
if result == -1:
More information about the grass-commit
mailing list