示例#1
0
unsigned int
TileSource::getMaxDataLevel() const
{
    //If we have no data extents, just use a reasonably high number
    if (_dataExtents.size() == 0) return 23;

    unsigned int maxDataLevel = 0;
    for (DataExtentList::const_iterator itr = _dataExtents.begin(); itr != _dataExtents.end(); ++itr)
    {
        if (itr->getMaxLevel() > maxDataLevel) maxDataLevel = itr->getMaxLevel();
    }
    return maxDataLevel;
}
示例#2
0
bool
TileSource::hasDataAtLOD( unsigned lod ) const
{
    //If no data extents are provided, just return true
    if ( _dataExtents.size() == 0 )
        return true;

    bool intersects = false;

    for (DataExtentList::const_iterator itr = _dataExtents.begin(); itr != _dataExtents.end(); ++itr)
    {
        if ( itr->getMinLevel() <= lod && lod <= itr->getMaxLevel() )
        {
            intersects = true;
            break;
        }
    }
    return intersects;
}
示例#3
0
bool
TileSource::hasData(const osgEarth::TileKey& key) const
{
    //If no data extents are provided, just return true
    if (_dataExtents.size() == 0) return true;

    const osgEarth::GeoExtent& keyExtent = key.getExtent();
    bool intersectsData = false;

    for (DataExtentList::const_iterator itr = _dataExtents.begin(); itr != _dataExtents.end(); ++itr)
    {
        if (keyExtent.intersects( *itr ) && key.getLevelOfDetail() >= itr->getMinLevel() && key.getLevelOfDetail() <= itr->getMaxLevel())
        {
            intersectsData = true;
            break;
        }
    }

    return intersectsData;
}