[GRASS-SVN] r71434 - grass/branches/releasebranch_7_2/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 23 13:04:41 PDT 2017


Author: mmetz
Date: 2017-08-23 13:04:41 -0700 (Wed, 23 Aug 2017)
New Revision: 71434

Modified:
   grass/branches/releasebranch_7_2/vector/v.out.ogr/attrb.c
Log:
v.out.ogr: preserve previous attribute export with GDAL 2.2+ (backport from trunk r71433)

Modified: grass/branches/releasebranch_7_2/vector/v.out.ogr/attrb.c
===================================================================
--- grass/branches/releasebranch_7_2/vector/v.out.ogr/attrb.c	2017-08-23 20:04:02 UTC (rev 71433)
+++ grass/branches/releasebranch_7_2/vector/v.out.ogr/attrb.c	2017-08-23 20:04:41 UTC (rev 71434)
@@ -94,7 +94,11 @@
 		    /* Reset */
 		    if ((nocat && strcmp(Fi->key, colname[j]) == 0) == 0) {
 			/* if this is 'cat', then execute the following only if the '-s' flag was NOT given*/
+#if GDAL_VERSION_NUM >= 2020000
+			OGR_F_SetFieldNull(Ogr_feature, ogrfieldnum);
+#else
 			OGR_F_UnsetField(Ogr_feature, ogrfieldnum);
+#endif
 		    }
 
 		    /* prevent writing NULL values */
@@ -129,6 +133,10 @@
 			    }
 			}
 		    }
+#if GDAL_VERSION_NUM >= 2020000
+		    else
+			OGR_F_SetFieldNull(Ogr_feature, ogrfieldnum);
+#endif
 		}
 	    }
 	    db_close_cursor(&cursor);



More information about the grass-commit mailing list