コード例 #1
0
ファイル: ogravcbinlayer.cpp プロジェクト: bbradbury/lib_gdal
OGRAVCBinLayer::OGRAVCBinLayer( OGRAVCBinDataSource *poDSIn,
                                AVCE00Section *psSectionIn ) :
    OGRAVCLayer( psSectionIn->eType, poDSIn ),
    m_psSection(psSectionIn),
    hFile(NULL),
    poArcLayer(NULL),
    bNeedReset(FALSE),
    hTable(NULL),
    nTableBaseField(-1),
    nTableAttrIndex(-1),
    nNextFID(1)
{
    SetupFeatureDefinition( m_psSection->pszName );

    szTableName[0] = '\0';
    if( m_psSection->eType == AVCFilePAL )
        snprintf( szTableName, sizeof(szTableName), "%s.PAT",
                  poDS->GetCoverageName() );
    else if( m_psSection->eType == AVCFileRPL )
        snprintf( szTableName, sizeof(szTableName), "%s.PAT%s",
                  poDS->GetCoverageName(), m_psSection->pszName );
    else if( m_psSection->eType == AVCFileARC )
        snprintf( szTableName, sizeof(szTableName), "%s.AAT",
                  poDS->GetCoverageName() );
    else if( m_psSection->eType == AVCFileLAB )
    {
        AVCE00ReadPtr psInfo
            = static_cast<OGRAVCBinDataSource *>( poDS) ->GetInfo();

        snprintf( szTableName, sizeof(szTableName), "%s.PAT",
                  poDS->GetCoverageName() );

        for( int iSection = 0; iSection < psInfo->numSections; iSection++ )
        {
            if( psInfo->pasSections[iSection].eType == AVCFilePAL )
                nTableAttrIndex = poFeatureDefn->GetFieldIndex( "PolyId" );
        }
    }

    CheckSetupTable();
}
コード例 #2
0
ファイル: ogravcbinlayer.cpp プロジェクト: garnertb/gdal
OGRAVCBinLayer::OGRAVCBinLayer( OGRAVCBinDataSource *poDSIn,
                                AVCE00Section *psSectionIn )
        : OGRAVCLayer( psSectionIn->eType, poDSIn )

{
    psSection = psSectionIn;
    hFile = NULL;
    poArcLayer = NULL;
    bNeedReset = FALSE;
    nNextFID = 1;

    hTable = NULL;
    nTableBaseField = -1;
    nTableAttrIndex = -1;

    SetupFeatureDefinition( psSection->pszName );
    
    szTableName[0] = '\0';
    if( psSection->eType == AVCFilePAL )
        sprintf( szTableName, "%s.PAT", poDS->GetCoverageName() );
    else if( psSection->eType == AVCFileRPL )
        sprintf( szTableName, "%s.PAT%s", poDS->GetCoverageName(),
                 psSectionIn->pszName );
    else if( psSection->eType == AVCFileARC )
        sprintf( szTableName, "%s.AAT", poDS->GetCoverageName() );
    else if( psSection->eType == AVCFileLAB )
    {
        AVCE00ReadPtr psInfo = ((OGRAVCBinDataSource *) poDS)->GetInfo();

        sprintf( szTableName, "%s.PAT", poDS->GetCoverageName() );

        for( int iSection = 0; iSection < psInfo->numSections; iSection++ )
        {
            if( psInfo->pasSections[iSection].eType == AVCFilePAL )
                nTableAttrIndex = poFeatureDefn->GetFieldIndex( "PolyId" );
        }
    }

    CheckSetupTable();
}