Class LevelSetConfig


  • public class LevelSetConfig
    extends java.lang.Object
    Configuration values for a multi-resolution, hierarchical collection of tiles organized into levels of increasing resolution.
    • 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 the level set.
      int numLevels
      The number of levels in the level set.
      Sector sector
      The sector spanned by the level set.
      int tileHeight
      The height in pixels of images associated with tiles in the level set, or the number of sample points in the latitudinal direction of elevation tiles associated with the level set.
      Location tileOrigin
      Tile origin for level set
      int tileWidth
      The width in pixels of images associated with tiles in the level set, or the number of sample points in the longitudinal direction of elevation tiles associated with the level set.
    • Constructor Summary

      Constructors 
      Constructor Description
      LevelSetConfig()
      Constructs a level set configuration with default values.
      LevelSetConfig​(Sector sector, double firstLevelDelta, int numLevels, int tileWidth, int tileHeight)
      Constructs a level set configuration with specified parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int numLevelsForMinResolution​(double radiansPerPixel)
      Returns the number of levels closest to the specified resolution, but does not exceed it.
      int numLevelsForResolution​(double radiansPerPixel)
      Returns the number of levels necessary to achieve the specified resolution.
      • 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 the level set.
      • tileOrigin

        public final Location tileOrigin
        Tile origin for level set
      • firstLevelDelta

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

        public int numLevels
        The number of levels in the level set.
      • tileWidth

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

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

      • LevelSetConfig

        public LevelSetConfig()
        Constructs a level set configuration with default values.
        • sector = -90 to +90 latitude and -180 to +180 longitude
        • firstLevelDelta = 90 degrees
        • numLevels = 1
        • tileWidth = 256
        • tileHeight = 256
      • LevelSetConfig

        public LevelSetConfig​(Sector sector,
                              double firstLevelDelta,
                              int numLevels,
                              int tileWidth,
                              int tileHeight)
        Constructs a level set configuration with specified parameters.
        Parameters:
        sector - the sector spanned by the level set, may be null in which case the sector spanning the full sphere is used
        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 the level set, or the number of sample points in the longitudinal direction of elevation tiles associate with the level set
        tileHeight - the height in pixels of images associated with tiles in the level set, or the number of sample points in the latitudinal direction of elevation tiles associate with the level set
    • Method Detail

      • numLevelsForResolution

        public int numLevelsForResolution​(double radiansPerPixel)
        Returns the number of levels necessary to achieve the specified resolution. The result is correct for this configuration's current firstLevelDelta, tileWidth and tileHeight, and is invalid if any of these values change.
        Parameters:
        radiansPerPixel - the desired resolution in radians per pixel
        Returns:
        the number of levels
        Throws:
        java.lang.IllegalArgumentException - If the resolution is not positive
      • numLevelsForMinResolution

        public int numLevelsForMinResolution​(double radiansPerPixel)
        Returns the number of levels closest to the specified resolution, but does not exceed it. May be used to configure level sets where a not to exceed resolution is mandated. The result is correct for this configuration's current firstLevelDelta, tileWidth and tileHeight, and is invalid if any of these values change.
        Parameters:
        radiansPerPixel - the desired not to exceed resolution in radians per pixel
        Returns:
        the number of levels
        Throws:
        java.lang.IllegalArgumentException - If the resolution is not positive