The gdalheaders API uses the following (pseudo-code) schemes for feature access.
The different feature loops, see https://github.com/dis-organization/dirigible/issues/5
Get all the feature thingys.
double nFeature = gdalheaders::force_layer_feature_count(poLayer);
/Vector out (nFeature);
List
double ii = 0;
while( (poFeature = poLayer->GetNextFeature()) != NULL ) {
[ii] = poFeature-><something>;
out::DestroyFeature(poFeature);
OGRFeature++;
ii}
Get a subset of feature thingys i:j - their positional index
(ij[1] - ij[0] + 1);
ListVector outdouble cnt = 0;
double ii = 0;
while( (poFeature = poLayer->GetNextFeature()) != NULL ) {
if (ii == ij[0] || (ii > ij[0] && ii <= ij[1])) {
[cnt] = poFeature-><something>;
out++;
cnt}
++;
ii::DestroyFeature(poFeature);
OGRFeature}
Get a subset of feature things, arbitrary i (in order) - their positional index
(ia.length());
ListVector outdouble ii = 0;
double cnt = 0;
while( (poFeature = poLayer->GetNextFeature()) != NULL ) {
if (ii == ia[cnt]) {
[cnt] = poFeature-><something>;
out++;
cnt}
++;
ii::DestroyFeature(poFeature);
OGRFeature}
Get a subset of feature thingys arbitrary FID (order irrelevant) - their FID unique names
(fa.length());
List out
for (double ii = 0; ii < fa.length(); ii++) {
= (GIntBig)fa[ii];
GIntBig feature_id = poLayer->GetFeature(feature_id);
poFeature