Skip to content
Permalink
Browse files

Remove safety check

Doesn't work correctly - flags valid matches as invalid
  • Loading branch information
nyalldawson committed Jun 1, 2018
1 parent 2975339 commit 6430059876cc34d915133ec7994abafef0227553
Showing with 0 additions and 15 deletions.
  1. +0 −15 src/providers/ogr/qgsogrfeatureiterator.cpp
@@ -207,21 +207,6 @@ bool QgsOgrFeatureIterator::fetchFeatureWithId( QgsFeatureId id, QgsFeature &fea
// filtered layer, not the original layer!
OGR_L_ResetReading( mOgrOrigLayer );
fet.reset( OGR_L_GetFeature( mOgrOrigLayer, FID_TO_NUMBER( id ) ) );

// do a bit of a safety check - make sure that the original fid column value
// matches the feature id which we actually requested.
OGRFeatureDefnH fdef = OGR_L_GetLayerDefn( mOgrOrigLayer );
int lastField = OGR_FD_GetFieldCount( fdef ) - 1;
bool foundCorrect = false;
if ( lastField >= 0 )
foundCorrect = OGR_F_GetFieldAsInteger64( fet.get(), lastField ) == id;
else
foundCorrect = OGR_F_GetFID( fet.get() ) == id;

if ( !foundCorrect )
{
fet.reset();
}
}
else
{

0 comments on commit 6430059

Please sign in to comment.
You can’t perform that action at this time.