Changes between Version 4 and Version 5 of rfc13_createfeatures


Ignore:
Timestamp:
May 15, 2007, 12:32:01 AM (17 years ago)
Author:
Kosta
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • rfc13_createfeatures

    v4 v5  
    77'''Summary'''
    88
    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).
     9Some 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).
    1010
    1111'''!CreateFeatures()'''
     
    3434Individual drivers can override the default implementation and can implement an optimized algorithm for inserting a set of features.
    3535
     36'''!SetFeatures()'''
     37
     38The following new virtual method is added to the OGRLayer class, with an analogous C function:
     39{{{
     40virtual OGRErr SetFeatures( OGRFeature** papoFeatures, int iFeatureCount );
     41}}}
     42
     43A default implementation is given as below:
     44{{{
     45OGRErr 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
     57This triggers the old behavior of an unoptimized update.
     58
     59Individual drivers can override the default implementation and can implement an optimized algorithm for updating a set of features.
     60
    3661'''Additional Notes'''
    3762
    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.
     63Based 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.
    3964
    4065See also ticket #1633.
     
    4570
    4671I can provide another patch based on this interface which contains the optimized implementation for the MySQL driver.
     72
     73'''History'''
     74
     7514-May-2007: initial version created[[BR]]
     7615-May-2007: !SetFeatures() added