[GRASS-SVN] r45910 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Apr 12 02:29:03 EDT 2011
Author: martinl
Date: 2011-04-11 23:29:03 -0700 (Mon, 11 Apr 2011)
New Revision: 45910
Modified:
grass/trunk/lib/vector/Vlib/build_ogr.c
grass/trunk/lib/vector/Vlib/open_ogr.c
Log:
vlib: OGR - support transaction when writing (v.external.out)
Modified: grass/trunk/lib/vector/Vlib/build_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_ogr.c 2011-04-11 22:31:35 UTC (rev 45909)
+++ grass/trunk/lib/vector/Vlib/build_ogr.c 2011-04-12 06:29:03 UTC (rev 45910)
@@ -361,6 +361,9 @@
Map->fInfo.ogr.offset = NULL;
Map->fInfo.ogr.offset_num = 0;
Map->fInfo.ogr.offset_alloc = 0;
+
+ if (OGR_L_TestCapability(Map->fInfo.ogr.layer, OLCTransactions))
+ OGR_L_CommitTransaction(Map->fInfo.ogr.layer);
/* test layer capabilities */
if (!OGR_L_TestCapability(Map->fInfo.ogr.layer, OLCRandomRead)) {
Modified: grass/trunk/lib/vector/Vlib/open_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_ogr.c 2011-04-11 22:31:35 UTC (rev 45909)
+++ grass/trunk/lib/vector/Vlib/open_ogr.c 2011-04-12 06:29:03 UTC (rev 45910)
@@ -95,6 +95,8 @@
G_debug(2, "OGR layer %d opened", layer);
Map->fInfo.ogr.layer = Ogr_layer;
+ if (update && OGR_L_TestCapability(Map->fInfo.ogr.layer, OLCTransactions))
+ OGR_L_StartTransaction(Map->fInfo.ogr.layer);
Map->fInfo.ogr.lines = NULL;
Map->fInfo.ogr.lines_types = NULL;
@@ -339,6 +341,9 @@
}
Map->fInfo.ogr.layer = Ogr_layer;
+ if (OGR_L_TestCapability(Map->fInfo.ogr.layer, OLCTransactions))
+ OGR_L_StartTransaction(Map->fInfo.ogr.layer);
+
return 0;
}
#endif
More information about the grass-commit
mailing list