Class LevelSet


  • public class LevelSet
    extends java.lang.Object
    Multi-resolution, hierarchical collection of tiles organized into levels of increasing resolution. Applications typically do not interact with this class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      double firstLevelDelta
      The geographic width and height in degrees of tiles in the first level (lowest resolution) of this level set.
      Sector sector
      The sector spanned by this level set.
      int tileHeight
      The height in pixels of images associated with tiles in this level set, or the number of sample points in the latitudinal direction of elevation tiles associated with this level set.
      Location tileOrigin
      Tile origin for this level set
      int tileWidth
      The width in pixels of images associated with tiles in this level set, or the number of sample points in the longitudinal direction of elevation tiles associated with this level set.
    • Constructor Summary

      Constructors 
      Constructor Description
      LevelSet()
      Constructs an empty level set with no levels.
      LevelSet​(Sector sector, Location tileOrigin, double firstLevelDelta, int numLevels, int tileWidth, int tileHeight)
      Constructs a level set with specified parameters.
      LevelSet​(LevelSetConfig config)
      Constructs a level set with parameters from a specified configuration.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Level firstLevel()
      Returns the first level (lowest resolution) of this level set.
      Level lastLevel()
      Returns the last level (highest resolution) of this level set.
      Level level​(int levelNumber)
      Returns the Level for a specified level number.
      Level levelForResolution​(double radiansPerPixel)
      Returns the level that most closely approximates the specified resolution.
      int numLevels()
      Returns the number of levels in this level set.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sector

        public final Sector sector
        The sector spanned by this level set.
      • tileOrigin

        public final Location tileOrigin
        Tile origin for this level set
      • firstLevelDelta

        public final double firstLevelDelta
        The geographic width and height in degrees of tiles in the first level (lowest resolution) of this level set.
      • tileWidth

        public final int tileWidth
        The width in pixels of images associated with tiles in this level set, or the number of sample points in the longitudinal direction of elevation tiles associated with this level set.
      • tileHeight

        public final int tileHeight
        The height in pixels of images associated with tiles in this level set, or the number of sample points in the latitudinal direction of elevation tiles associated with this level set.
    • Constructor Detail

      • LevelSet

        public LevelSet()
        Constructs an empty level set with no levels. The methods level, levelForResolution, firstLevel and lastLevel always return null.
      • LevelSet

        public LevelSet​(Sector sector,
                        Location tileOrigin,
                        double firstLevelDelta,
                        int numLevels,
                        int tileWidth,
                        int tileHeight)
        Constructs a level set with specified parameters.
        Parameters:
        sector - the sector spanned by this level set
        tileOrigin - the origin for this level set
        firstLevelDelta - the geographic width and height in degrees of tiles in the first level (lowest resolution) of the level set
        numLevels - the number of levels in the level set
        tileWidth - the height in pixels of images associated with tiles in this level set, or the number of sample points in the longitudinal direction of elevation tiles associate with this level set
        tileHeight - the height in pixels of images associated with tiles in this level set, or the number of sample points in the latitudinal direction of elevation tiles associate with this level set
        Throws:
        java.lang.IllegalArgumentException - If any argument is null, or if any dimension is zero
      • LevelSet

        public LevelSet​(LevelSetConfig config)
        Constructs a level set with parameters from a specified configuration. The configuration's sector must be non-null, its first level delta must be positive, its number of levels must be 1 or more, and its tile width and tile height must be 1 or greater.
        Parameters:
        config - the configuration for this level set
        Throws:
        java.lang.IllegalArgumentException - If the configuration is null, or if any configuration value is invalid
    • Method Detail

      • numLevels

        public int numLevels()
        Returns the number of levels in this level set.
        Returns:
        the number of levels
      • level

        public Level level​(int levelNumber)
        Returns the Level for a specified level number.
        Parameters:
        levelNumber - the number of the desired level
        Returns:
        the requested level, or null if the level does not exist
      • levelForResolution

        public Level levelForResolution​(double radiansPerPixel)
        Returns the level that most closely approximates the specified resolution.
        Parameters:
        radiansPerPixel - the desired resolution in radians per pixel
        Returns:
        the level for the specified resolution, or null if this level set is empty
        Throws:
        java.lang.IllegalArgumentException - If the resolution is not positive
      • firstLevel

        public Level firstLevel()
        Returns the first level (lowest resolution) of this level set.
        Returns:
        the level of lowest resolution, or null if this level set is empty
      • lastLevel

        public Level lastLevel()
        Returns the last level (highest resolution) of this level set.
        Returns:
        the level of highest resolution, or null if this level set is empty