当前位置: 首页>>代码示例>>C++>>正文


C++ VRTDataset::BuildVirtualOverviews方法代码示例

本文整理汇总了C++中VRTDataset::BuildVirtualOverviews方法的典型用法代码示例。如果您正苦于以下问题:C++ VRTDataset::BuildVirtualOverviews方法的具体用法?C++ VRTDataset::BuildVirtualOverviews怎么用?C++ VRTDataset::BuildVirtualOverviews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VRTDataset的用法示例。


在下文中一共展示了VRTDataset::BuildVirtualOverviews方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GDALOpenShared

GDALRasterBand *VRTRasterBand::GetOverview( int iOverview )

{
    // First: overviews declared in <Overview> element
    if( !m_apoOverviews.empty() )
    {
        if( iOverview < 0
            || iOverview >= static_cast<int>( m_apoOverviews.size() ) )
            return NULL;

        if( m_apoOverviews[iOverview].poBand == NULL
            && !m_apoOverviews[iOverview].bTriedToOpen )
        {
            m_apoOverviews[iOverview].bTriedToOpen = TRUE;

            GDALDataset *poSrcDS = reinterpret_cast<GDALDataset *>(
                GDALOpenShared( m_apoOverviews[iOverview].osFilename,
                                GA_ReadOnly ) );

            if( poSrcDS == NULL )
                return NULL;

            m_apoOverviews[iOverview].poBand = poSrcDS->GetRasterBand(
                m_apoOverviews[iOverview].nBand );

            if (m_apoOverviews[iOverview].poBand == NULL)
            {
                GDALClose( (GDALDatasetH)poSrcDS );
            }
        }

        return m_apoOverviews[iOverview].poBand;
    }

    // If not found, external .ovr overviews
    GDALRasterBand* poRet = GDALRasterBand::GetOverview( iOverview );
    if( poRet )
        return poRet;

    // If not found, implicit virtual overviews
    VRTDataset* poVRTDS = reinterpret_cast<VRTDataset *>( poDS );
    poVRTDS->BuildVirtualOverviews();
    if( !poVRTDS->m_apoOverviews.empty() && poVRTDS->m_apoOverviews[0] )
    {
        if( iOverview < 0
            || iOverview >= static_cast<int>( poVRTDS->m_apoOverviews.size() ) )
            return NULL;

        return poVRTDS->m_apoOverviews[iOverview]->GetRasterBand(nBand);
    }

    return NULL;
}
开发者ID:Mavrx-inc,项目名称:gdal,代码行数:53,代码来源:vrtrasterband.cpp

示例2: GDALOpenShared

GDALRasterBand *VRTRasterBand::GetOverview( int iOverview )

{
    // First: overviews declared in <Overview> element
    if( apoOverviews.size() > 0 )
    {
        if( iOverview < 0 || iOverview >= (int) apoOverviews.size() )
            return NULL;

        if( apoOverviews[iOverview].poBand == NULL 
            && !apoOverviews[iOverview].bTriedToOpen )
        {
            apoOverviews[iOverview].bTriedToOpen = TRUE;

            GDALDataset *poSrcDS = (GDALDataset *)
                GDALOpenShared( apoOverviews[iOverview].osFilename, GA_ReadOnly );
            
            if( poSrcDS == NULL )
                return NULL;

            apoOverviews[iOverview].poBand = poSrcDS->GetRasterBand( 
                apoOverviews[iOverview].nBand );

            if (apoOverviews[iOverview].poBand == NULL)
            {
                GDALClose( (GDALDatasetH)poSrcDS );
            }
        }

        return apoOverviews[iOverview].poBand;
    }
    
    // If not found, external .ovr overviews
    GDALRasterBand* poRet = GDALRasterBand::GetOverview( iOverview );
    if( poRet )
        return poRet;
    
    // If not found, implicit virtual overviews
    VRTDataset* poVRTDS = ((VRTDataset *)poDS);
    poVRTDS->BuildVirtualOverviews();
    if( poVRTDS->apoOverviews.size() && poVRTDS->apoOverviews[0] )
    {
        if( iOverview < 0 || iOverview >= (int) poVRTDS->apoOverviews.size() )
            return NULL;
        return poVRTDS->apoOverviews[iOverview]->GetRasterBand(nBand);
    }
    
    return NULL;
}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:49,代码来源:vrtrasterband.cpp

示例3: GetOverviewCount

int VRTRasterBand::GetOverviewCount()

{
    // First: overviews declared in <Overview> element
    if( !m_apoOverviews.empty() )
        return static_cast<int>(m_apoOverviews.size());

    // If not found, external .ovr overviews
    const int nOverviewCount = GDALRasterBand::GetOverviewCount();
    if( nOverviewCount )
        return nOverviewCount;

    // If not found, implicit virtual overviews
    VRTDataset* poVRTDS = reinterpret_cast<VRTDataset *>( poDS );
    poVRTDS->BuildVirtualOverviews();
    if( !poVRTDS->m_apoOverviews.empty() && poVRTDS->m_apoOverviews[0] )
        return static_cast<int>( poVRTDS->m_apoOverviews.size() );

    return 0;
}
开发者ID:Mavrx-inc,项目名称:gdal,代码行数:20,代码来源:vrtrasterband.cpp

示例4: GetOverviewCount

int VRTRasterBand::GetOverviewCount()

{
    // First: overviews declared in <Overview> element
    if( apoOverviews.size() > 0 )
        return apoOverviews.size();

    // If not found, external .ovr overviews
    int nOverviewCount = GDALRasterBand::GetOverviewCount();
    if( nOverviewCount )
        return nOverviewCount;

    // If not found, implicit virtual overviews
    VRTDataset* poVRTDS = ((VRTDataset *)poDS);
    poVRTDS->BuildVirtualOverviews();
    if( poVRTDS->apoOverviews.size() && poVRTDS->apoOverviews[0] )
        return (int)poVRTDS->apoOverviews.size();

    return 0;
}
开发者ID:rashadkm,项目名称:lib_gdal,代码行数:20,代码来源:vrtrasterband.cpp


注:本文中的VRTDataset::BuildVirtualOverviews方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。