OGRFeature *OGRPCIDSKLayer::GetNextFeature() { OGRFeature *poFeature = NULL; /* -------------------------------------------------------------------- */ /* Read features till we find one that satisfies our current */ /* spatial criteria. */ /* -------------------------------------------------------------------- */ while( TRUE ) { poFeature = GetNextUnfilteredFeature(); if( poFeature == NULL ) break; if( (m_poFilterGeom == NULL || FilterGeometry( poFeature->GetGeometryRef() ) ) && (m_poAttrQuery == NULL || m_poAttrQuery->Evaluate( poFeature )) ) break; delete poFeature; } return poFeature; }
OGRFeature *OGRS57Layer::GetNextUnfilteredFeature() { OGRFeature *poFeature = NULL; /* -------------------------------------------------------------------- */ /* Are we out of modules to request features from? */ /* -------------------------------------------------------------------- */ if( nCurrentModule >= poDS->GetModuleCount() ) return NULL; /* -------------------------------------------------------------------- */ /* Set the current position on the current module and fetch a */ /* feature. */ /* -------------------------------------------------------------------- */ S57Reader *poReader = poDS->GetModule(nCurrentModule); if( poReader != NULL ) { poReader->SetNextFEIndex( nNextFEIndex, nRCNM ); poFeature = poReader->ReadNextFeature( poFeatureDefn ); nNextFEIndex = poReader->GetNextFEIndex( nRCNM ); } /* -------------------------------------------------------------------- */ /* If we didn't get a feature we need to move onto the next file. */ /* -------------------------------------------------------------------- */ if( poFeature == NULL ) { nCurrentModule++; poReader = poDS->GetModule(nCurrentModule); if( poReader != NULL && poReader->GetModule() == NULL ) { if( !poReader->Open( FALSE ) ) return NULL; } return GetNextUnfilteredFeature(); } else { m_nFeaturesRead++; if( poFeature->GetGeometryRef() != NULL ) poFeature->GetGeometryRef()->assignSpatialReference( GetSpatialRef() ); } return poFeature; }
OGRFeature *OGRDWGBlocksLayer::GetNextFeature() { while( TRUE ) { OGRFeature *poFeature = GetNextUnfilteredFeature(); if( poFeature == NULL ) return NULL; if( (m_poFilterGeom == NULL || FilterGeometry( poFeature->GetGeometryRef() ) ) && (m_poAttrQuery == NULL || m_poAttrQuery->Evaluate( poFeature ) ) ) { return poFeature; } delete poFeature; } }
OGRFeature *OGRDXFBlocksLayer::GetNextFeature() { while( true ) { OGRFeature *poFeature = GetNextUnfilteredFeature(); if( poFeature == nullptr ) return nullptr; if( (m_poFilterGeom == nullptr || FilterGeometry( poFeature->GetGeometryRef() ) ) && (m_poAttrQuery == nullptr || m_poAttrQuery->Evaluate( poFeature ) ) ) { return poFeature; } delete poFeature; } }
OGRFeature *OGRRECLayer::GetNextFeature() { OGRFeature *poFeature = NULL; /* -------------------------------------------------------------------- */ /* Read features till we find one that satisfies our current */ /* spatial criteria. */ /* -------------------------------------------------------------------- */ while( true ) { poFeature = GetNextUnfilteredFeature(); if( poFeature == NULL ) break; if( m_poAttrQuery == NULL || m_poAttrQuery->Evaluate( poFeature ) ) break; delete poFeature; } return poFeature; }