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

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


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

Modified:
   grass/trunk/vector/v.out.ogr/attrb.c
Log:
v.out.ogr: preserve previous attribute export with GDAL 2.2+

Modified: grass/trunk/vector/v.out.ogr/attrb.c
===================================================================
--- grass/trunk/vector/v.out.ogr/attrb.c	2017-08-23 16:54:36 UTC (rev 71432)
+++ grass/trunk/vector/v.out.ogr/attrb.c	2017-08-23 20:04:02 UTC (rev 71433)
@@ -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