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

    unsigned int minDataLevel = INT_MAX;
    for (DataExtentList::const_iterator itr = _dataExtents.begin(); itr != _dataExtents.end(); ++itr)
    {
        if (itr->getMinLevel() < minDataLevel) minDataLevel = itr->getMinLevel();
    }
    return minDataLevel;
}
示例#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;
}