[GRASS-SVN] r58392 - grass/trunk/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 5 10:34:26 PST 2013


Author: martinl
Date: 2013-12-05 10:34:25 -0800 (Thu, 05 Dec 2013)
New Revision: 58392

Modified:
   grass/trunk/vector/v.out.ogr/attrb.c
Log:
v.out.ogr: fix exporting features with no category

Modified: grass/trunk/vector/v.out.ogr/attrb.c
===================================================================
--- grass/trunk/vector/v.out.ogr/attrb.c	2013-12-05 18:28:40 UTC (rev 58391)
+++ grass/trunk/vector/v.out.ogr/attrb.c	2013-12-05 18:34:25 UTC (rev 58392)
@@ -29,7 +29,8 @@
     /* Reset */
     if (!doatt) {
 	ogrfieldnum = OGR_F_GetFieldIndex(Ogr_feature, GV_KEY_COLUMN);
-	OGR_F_UnsetField(Ogr_feature, ogrfieldnum);
+        if (ogrfieldnum > -1)
+            OGR_F_UnsetField(Ogr_feature, ogrfieldnum);
 	/* doatt reset moved into have cat loop as the table needs to be
 	   open to know the OGR field ID. Hopefully this has no ill consequences */
     }



More information about the grass-commit mailing list