Changes between Version 4 and Version 5 of rfc13_createfeatures
- Timestamp:
- May 15, 2007, 12:32:01 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
rfc13_createfeatures
v4 v5 7 7 '''Summary''' 8 8 9 Some OGR drivers can dramatically increase the speed of and optimize the insertion of a set of features, if the driver knows, that there is a whole set of features that should/could be inserted at once (instead of just one by one).9 Some OGR drivers can dramatically increase the speed of and optimize the insertion of a set of features, if the driver knows, that there is a whole set of features that should/could be inserted or updated at once (instead of just one by one). 10 10 11 11 '''!CreateFeatures()''' … … 34 34 Individual drivers can override the default implementation and can implement an optimized algorithm for inserting a set of features. 35 35 36 '''!SetFeatures()''' 37 38 The following new virtual method is added to the OGRLayer class, with an analogous C function: 39 {{{ 40 virtual OGRErr SetFeatures( OGRFeature** papoFeatures, int iFeatureCount ); 41 }}} 42 43 A default implementation is given as below: 44 {{{ 45 OGRErr OGRLayer::SetFeatures( 46 OGRFeature **papoFeatures, 47 int iFeatureCount 48 ) { 49 for(int i = 0; i < iFeatureCount; ++i) { 50 OGRErr error = SetFeature( papoFeatures[i] ); 51 if( error != OGRERR_NONE ) return error; 52 } 53 return OGRERR_NONE; 54 } 55 }}} 56 57 This triggers the old behavior of an unoptimized update. 58 59 Individual drivers can override the default implementation and can implement an optimized algorithm for updating a set of features. 60 36 61 '''Additional Notes''' 37 62 38 Based in this new interface function , I was able to increase the insertion speed of features in the MySQL driver from 40 per second to up to 800-2000 per second. I think other drivers can benefit from this change, too.63 Based in this new interface functions, I was able to increase the insertion speed of features in the MySQL driver from 40 per second to up to 800-2000 per second. I think other drivers can benefit from this change, too. 39 64 40 65 See also ticket #1633. … … 45 70 46 71 I can provide another patch based on this interface which contains the optimized implementation for the MySQL driver. 72 73 '''History''' 74 75 14-May-2007: initial version created[[BR]] 76 15-May-2007: !SetFeatures() added