當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetNextRawFeature函數代碼示例

本文整理匯總了C++中GetNextRawFeature函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetNextRawFeature函數的具體用法?C++ GetNextRawFeature怎麽用?C++ GetNextRawFeature使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetNextRawFeature函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: while

OGRFeature *OGRIdrisiLayer::GetNextFeature()
{
    OGRFeature  *poFeature;

    while(TRUE)
    {
        if (bEOF)
            return NULL;

        poFeature = GetNextRawFeature();
        if (poFeature == NULL)
        {
            bEOF = TRUE;
            return NULL;
        }

        if((m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeometryRef() ) )
        && (m_poAttrQuery == NULL
            || m_poAttrQuery->Evaluate( poFeature )) )
        {
            return poFeature;
        }
        else
            delete poFeature;
    }
}
開發者ID:rashadkm,項目名稱:lib_gdal,代碼行數:27,代碼來源:ogridrisilayer.cpp

示例2: while

OGRFeature *OGRHTFLayer::GetNextFeature()
{
    OGRFeature  *poFeature;

    if (fpHTF == NULL || bEOF)
        return NULL;

    while(!bEOF)
    {
        poFeature = GetNextRawFeature();
        if (poFeature == NULL)
            return NULL;

        if((m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeometryRef() ) )
        && (m_poAttrQuery == NULL
            || m_poAttrQuery->Evaluate( poFeature )) )
        {
            return poFeature;
        }
        else
            delete poFeature;
    }

    return NULL;
}
開發者ID:AsherBond,項目名稱:MondocosmOS,代碼行數:26,代碼來源:ogrhtflayer.cpp

示例3: GetLayerDefn

OGRFeature *OGRGFTLayer::GetNextFeature()
{
    GetLayerDefn();

    while( true )
    {
        if (nNextInSeq < nOffset ||
            nNextInSeq >= nOffset + static_cast<int>(aosRows.size()))
        {
            if (bEOF)
                return nullptr;

            nOffset += static_cast<int>(aosRows.size());
            if (!FetchNextRows())
                return nullptr;
        }

        OGRFeature *poFeature = GetNextRawFeature();
        if (poFeature == nullptr)
            return nullptr;

        if((m_poFilterGeom == nullptr
            || FilterGeometry( poFeature->GetGeometryRef() ) )
        && (m_poAttrQuery == nullptr
            || m_poAttrQuery->Evaluate( poFeature )) )
        {
            return poFeature;
        }
        else
            delete poFeature;
    }
}
開發者ID:koordinates,項目名稱:gdal,代碼行數:32,代碼來源:ogrgftlayer.cpp

示例4: ResetReading

OGRFeature *OGROGDILayer::GetNextFeature()

{
    OGRFeature  *poFeature;

    /* Reset reading if we are not the current layer */
    /* WARNING : this does not allow interleaved reading of layers */
    if( m_poODS->GetCurrentLayer() != this )
    {
        m_poODS->SetCurrentLayer(this);
        ResetReading();
    }

    while( true )
    {
        poFeature = GetNextRawFeature();
        if( poFeature == NULL )
            return NULL;

    /* -------------------------------------------------------------------- */
    /*      Do we need to apply an attribute test?                          */
    /* -------------------------------------------------------------------- */
        if( (m_poAttrQuery != NULL
            && !m_poAttrQuery->Evaluate( poFeature ) )
            || (m_poFilterGeom != NULL
                && !FilterGeometry( poFeature->GetGeometryRef() ) ) )
        {
            m_nFilteredOutShapes ++;
            delete poFeature;
        }
        else
            return poFeature;
    }
}
開發者ID:Wedjaa,項目名稱:node-gdal,代碼行數:34,代碼來源:ogrogdilayer.cpp

示例5: ClearStatement

OGRFeature *OGRWalkTableLayer::GetFeature( long nFeatureId )

{
    if( pszFIDColumn == NULL )
        return OGRWalkLayer::GetFeature( nFeatureId );

    ClearStatement();

    iNextShapeId = nFeatureId;

    poStmt = new CPLODBCStatement( poDS->GetSession() );
    poStmt->Append( "SELECT * FROM " );
    poStmt->Append( poFeatureDefn->GetName() );
    poStmt->Append( "Features" );
    poStmt->Appendf( " WHERE %s = %ld", pszFIDColumn, nFeatureId );

    if( !poStmt->ExecuteSQL() )
    {
        delete poStmt;
        poStmt = NULL;
        return NULL;
    }

    return GetNextRawFeature();
}
開發者ID:samalone,項目名稱:gdal-ios,代碼行數:25,代碼來源:ogrwalktablelayer.cpp

示例6: GetNextRawFeature

OGRFeature *OGRPGResultLayer::GetNextFeature()

{
    OGRPGGeomFieldDefn* poGeomFieldDefn = NULL;
    if( poFeatureDefn->GetGeomFieldCount() != 0 )
        poGeomFieldDefn = poFeatureDefn->myGetGeomFieldDefn(m_iGeomFieldFilter);

    for( ; TRUE; )
    {
        OGRFeature      *poFeature;

        poFeature = GetNextRawFeature();
        if( poFeature == NULL )
            return NULL;

        if( (m_poFilterGeom == NULL
            || poGeomFieldDefn == NULL
            || poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY
            || poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY
            || FilterGeometry( poFeature->GetGeomFieldRef(m_iGeomFieldFilter) ) )
            && (m_poAttrQuery == NULL
                || m_poAttrQuery->Evaluate( poFeature )) )
            return poFeature;

        delete poFeature;
    }
}
開發者ID:0004c,項目名稱:node-gdal,代碼行數:27,代碼來源:ogrpgresultlayer.cpp

示例7: GetLayerDefn

OGRFeature *OGRGFTLayer::GetNextFeature()
{
    OGRFeature  *poFeature;

    GetLayerDefn();

    while(TRUE)
    {
        if (nNextInSeq < nOffset ||
            nNextInSeq >= nOffset + (int)aosRows.size())
        {
            if (bEOF)
                return NULL;

            nOffset += aosRows.size();
            if (!FetchNextRows())
                return NULL;
        }

        poFeature = GetNextRawFeature();
        if (poFeature == NULL)
            return NULL;

        if((m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeometryRef() ) )
        && (m_poAttrQuery == NULL
            || m_poAttrQuery->Evaluate( poFeature )) )
        {
            return poFeature;
        }
        else
            delete poFeature;
    }
}
開發者ID:samalone,項目名稱:gdal-ios,代碼行數:34,代碼來源:ogrgftlayer.cpp

示例8: while

OGRFeature *OGRGMELayer::GetNextFeature()
{
    OGRFeature *poFeature = NULL;
    
    while( TRUE )
    {
        poFeature = GetNextRawFeature();
        if( poFeature == NULL )
            break;

        // incremeted in GetNextRawFeature()
        // m_nFeaturesRead++;

        if( (m_poFilterGeom == NULL
             || poFeature->GetGeometryRef() == NULL 
             || FilterGeometry( poFeature->GetGeometryRef() ) )
            && (m_poAttrQuery == NULL
                || m_poAttrQuery->Evaluate( poFeature )) )
            break;

        delete poFeature;
    }

    return poFeature;
}
開發者ID:samalone,項目名稱:gdal-ios,代碼行數:25,代碼來源:ogrgmelayer.cpp

示例9: ClearQuery

OGRFeature *OGRIDBTableLayer::GetFeature( GIntBig nFeatureId )

{
    if( pszFIDColumn == NULL )
        return OGRIDBLayer::GetFeature( nFeatureId );

    ClearQuery();

    iNextShapeId = nFeatureId;

    poCurr = new ITCursor( *poDS->GetConnection() );

    // Create list of fields
    CPLString osFields;

    if ( poFeatureDefn->GetFieldIndex( pszFIDColumn ) == -1 )
        osFields += pszFIDColumn;

    if ( pszGeomColumn )
    {
        if ( ! osFields.empty() )
            osFields += ",";

        osFields += "st_asbinary(";
        osFields += pszGeomColumn;
        osFields += ") as ";
        osFields += pszGeomColumn;
    }

    for( int i = 0; i < poFeatureDefn->GetFieldCount(); i++ )
    {
        if ( ! osFields.empty() )
            osFields += ",";

        osFields += poFeatureDefn->GetFieldDefn(i)->GetNameRef();
    }

    CPLString sql;

    sql.Printf( "SELECT %s FROM %s WHERE %s = %d",
                osFields.c_str(), poFeatureDefn->GetName(),
                pszFIDColumn, nFeatureId );

    CPLDebug( "OGR_IDB", "ExecuteSQL(%s)", sql.c_str() );
    if( !poCurr->Prepare( sql.c_str() ) ||
        !poCurr->Open(ITCursor::ReadOnly) )
    {
        delete poCurr;
        poCurr = NULL;
        return NULL;
    }

    return GetNextRawFeature();
}
開發者ID:Wedjaa,項目名稱:node-gdal,代碼行數:54,代碼來源:ogridbtablelayer.cpp

示例10: GetNextRawFeature

OGRFeature *OGRPLScenesLayer::GetNextFeature()
{
    if( !bFilterMustBeClientSideEvaluated )
        return GetNextRawFeature();

    while( true )
    {
        OGRFeature *poFeature = NULL;
        poFeature = GetNextRawFeature();
        if (poFeature == NULL)
            return NULL;

        if((m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeometryRef() ) )
        && (m_poAttrQuery == NULL
            || m_poAttrQuery->Evaluate( poFeature )) )
        {
            return poFeature;
        }
        else
            delete poFeature;
    }
}
開發者ID:ryandavid,項目名稱:rotobox,代碼行數:23,代碼來源:ogrplsceneslayer.cpp

示例11: SetSpatialFilter

OGRFeature *OGROGDILayer::GetFeature( GIntBig nFeatureId )

{
    ecs_Result  *psResult;

    if (m_nTotalShapeCount != -1 && nFeatureId > m_nTotalShapeCount)
        return NULL;

    /* Unset spatial filter */
    OGRGeometry* poOldFilterGeom = ( m_poFilterGeom != NULL ) ? m_poFilterGeom->clone() : NULL;
    if( poOldFilterGeom != NULL )
        SetSpatialFilter(NULL);

    /* Reset reading if we are not the current layer */
    /* WARNING : this does not allow interleaved reading of layers */
    if( m_poODS->GetCurrentLayer() != this )
    {
        m_poODS->SetCurrentLayer(this);
        ResetReading();
    }
    else if ( nFeatureId < m_iNextShapeId )
        ResetReading();

    while(m_iNextShapeId != nFeatureId)
    {
        psResult = cln_GetNextObject(m_nClientID);
        if (ECSSUCCESS(psResult))
            m_iNextShapeId++;
        else
        {
            // We probably reached EOF... keep track of shape count.
            m_nTotalShapeCount = m_iNextShapeId;
            if( poOldFilterGeom != NULL )
            {
                SetSpatialFilter(poOldFilterGeom);
                delete poOldFilterGeom;
            }
            return NULL;
        }
    }

    // OK, we're ready to read the requested feature...
    OGRFeature* poFeature = GetNextRawFeature();
    if( poOldFilterGeom != NULL )
    {
        SetSpatialFilter(poOldFilterGeom);
        delete poOldFilterGeom;
    }
    return poFeature;
}
開發者ID:Wedjaa,項目名稱:node-gdal,代碼行數:50,代碼來源:ogrogdilayer.cpp

示例12: while

OGRFeature *OGRWalkLayer::GetNextFeature()

{
    while( true )
    {
        OGRFeature *poFeature = GetNextRawFeature();
        if( poFeature == nullptr )
            return nullptr;

        if( (m_poFilterGeom == nullptr
            || FilterGeometry( poFeature->GetGeometryRef() ) )
            && (m_poAttrQuery == nullptr
                || m_poAttrQuery->Evaluate( poFeature )) )
            return poFeature;

        delete poFeature;
    }
}
開發者ID:koordinates,項目名稱:gdal,代碼行數:18,代碼來源:ogrwalklayer.cpp

示例13: while

OGRFeature *OGRIngresLayer::GetNextFeature()

{
    while( true )
    {
        OGRFeature *poFeature = GetNextRawFeature();
        if( poFeature == NULL )
            return NULL;

        if( (m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeometryRef() ) )
            && (m_poAttrQuery == NULL
                || m_poAttrQuery->Evaluate( poFeature )) )
            return poFeature;

        delete poFeature;
    }
}
開發者ID:Mavrx-inc,項目名稱:gdal,代碼行數:18,代碼來源:ogringreslayer.cpp

示例14: GetNextRawFeature

OGRFeature *OGRMDBLayer::GetNextFeature()

{
    for( ; TRUE; )
    {
        OGRFeature      *poFeature;

        poFeature = GetNextRawFeature();
        if( poFeature == NULL )
            return NULL;

        if( (m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeometryRef() ) )
            && (m_poAttrQuery == NULL
                || m_poAttrQuery->Evaluate( poFeature )) )
            return poFeature;

        delete poFeature;
    }
}
開發者ID:0004c,項目名稱:node-gdal,代碼行數:20,代碼來源:ogrmdblayer.cpp

示例15: GetLayerDefn

OGRFeature *OGRXLSLayer::GetNextFeature()
{
    GetLayerDefn();

    while( true )
    {
        OGRFeature *poFeature = GetNextRawFeature();
        if (poFeature == nullptr)
            return nullptr;

        if(/*(m_poFilterGeom == NULL
            || FilterGeometry( poFeature->GetGeometryRef() ) )
        && */ (m_poAttrQuery == nullptr
            || m_poAttrQuery->Evaluate( poFeature )) )
        {
            return poFeature;
        }
        else
            delete poFeature;
    }
}
開發者ID:OSGeo,項目名稱:gdal,代碼行數:21,代碼來源:ogrxlslayer.cpp


注:本文中的GetNextRawFeature函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。