Class TiledRasterProducer

    • Constructor Detail

      • TiledRasterProducer

        public TiledRasterProducer​(MemoryCache cache,
                                   int writeThreadPoolSize)
      • TiledRasterProducer

        public TiledRasterProducer()
    • Method Detail

      • getDataRasters

        public java.lang.Iterable<DataRaster> getDataRasters()
      • getDataSourceDescription

        public java.lang.String getDataSourceDescription()
      • createDataRaster

        protected abstract DataRaster createDataRaster​(int width,
                                                       int height,
                                                       Sector sector,
                                                       AVList params)
      • getDataRasterReaders

        protected abstract DataRasterReader[] getDataRasterReaders()
      • getDataRasterWriters

        protected abstract DataRasterWriter[] getDataRasterWriters()
      • getTileWriteService

        protected java.util.concurrent.ExecutorService getTileWriteService()
      • getTileWriteSemaphore

        protected java.util.concurrent.Semaphore getTileWriteSemaphore()
      • installLocationFor

        protected java.io.File installLocationFor​(AVList params)
      • initProductionParameters

        protected abstract void initProductionParameters​(AVList params)
      • initLevelSetParameters

        protected void initLevelSetParameters​(AVList params)
      • computeIntegralLevelZeroTileDelta

        protected LatLon computeIntegralLevelZeroTileDelta​(LatLon originalDelta)
      • isDataSetLarge

        protected boolean isDataSetLarge​(java.lang.Iterable<? extends DataRaster> rasters,
                                         int largeThreshold)
      • isWithinLatLonLimits

        protected boolean isWithinLatLonLimits​(Sector sector,
                                               LatLon tileDelta,
                                               LatLon tileOrigin)
      • computeBoundingSector

        protected Sector computeBoundingSector​(java.lang.Iterable<? extends DataRaster> rasters)
      • computeRasterTileDelta

        protected LatLon computeRasterTileDelta​(int tileWidth,
                                                int tileHeight,
                                                java.lang.Iterable<? extends DataRaster> rasters)
      • computeDesiredTileDelta

        protected LatLon computeDesiredTileDelta​(Sector sector)
      • computeRasterPixelSize

        protected LatLon computeRasterPixelSize​(DataRaster raster)
      • computeSmallestPixelSize

        protected LatLon computeSmallestPixelSize​(java.lang.Iterable<? extends DataRaster> rasters)
      • computeNumLevels

        protected int computeNumLevels​(LatLon levelZeroDelta,
                                       LatLon lastLevelDelta)
      • assembleDataRasters

        protected void assembleDataRasters()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • assembleDataSource

        protected void assembleDataSource​(java.lang.Object source,
                                          AVList params)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createDefaultCache

        protected static MemoryCache createDefaultCache()
      • installLevelSet

        protected void installLevelSet​(LevelSet levelSet,
                                       AVList params)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • createTileRaster

        protected DataRaster createTileRaster​(LevelSet levelSet,
                                              Tile tile,
                                              AVList params)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • drawDataSources

        protected DataRaster drawDataSources​(LevelSet levelSet,
                                             Tile tile,
                                             java.lang.Iterable<DataRaster> dataRasters,
                                             AVList params)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • drawDescendants

        protected DataRaster drawDescendants​(LevelSet levelSet,
                                             Tile tile,
                                             AVList params)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • createSubTiles

        protected Tile[] createSubTiles​(Tile tile,
                                        Level nextLevel)
      • isFinalLevel

        protected boolean isFinalLevel​(LevelSet levelSet,
                                       int levelNumber,
                                       AVList params)
      • extractMaxLevelLimit

        protected int extractMaxLevelLimit​(AVList params,
                                           int maxNumOfLevels)
        Extracts a maximum level limit from the AVList if the AVList contains AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL. This method requires maxNumOfLevels - the actual maximum numbers of levels.

        The AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL could specify multiple things:

        If the value of the AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL is "Auto" (as String), the calculated limit of levels will be 70% of the actual maximum numbers of levels maxNumOfLevels.

        If the type of the value of the AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL is Integer, it should contain an integer number between 0 (for level 0 only) and the actual maximum numbers of levels maxNumOfLevels.

        It is also possible to specify the limit as percents, in this case the type of the AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL value must be "String", have a numeric value as text and the "%" percent sign in the end. Examples: "100%", "25%", "50%", etc.

        Value of AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL could be a numeric string (for example, "3"), or Integer. The value will be correctly extracted and compared with the maxNumOfLevels. Valid values must be smaller or equal to maxNumOfLevels.

        Parameters:
        params - AVList that may contain AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL property
        maxNumOfLevels - The actual maximum numbers of levels
        Returns:
        A limit of numbers of levels that should producer generate.
      • createDefaultTileWriteService

        protected java.util.concurrent.ExecutorService createDefaultTileWriteService​(int threadPoolSize)
      • installTileRasterComplete

        protected void installTileRasterComplete()
      • waitForInstallTileTasks

        protected void waitForInstallTileTasks()
      • installTileRaster

        protected void installTileRaster​(Tile tile,
                                         DataRaster tileRaster,
                                         AVList params)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • installLocationForTile

        protected java.lang.Object installLocationForTile​(AVList installParams,
                                                          Tile tile)
      • findWriterFor

        protected java.lang.Object findWriterFor​(DataRaster raster,
                                                 java.lang.String formatSuffix,
                                                 java.io.File destination,
                                                 DataRasterWriter[] writers)
      • createConfigDoc

        protected abstract org.w3c.dom.Document createConfigDoc​(AVList params)
        Returns a configuration document which describes the tiled data produced by this TiledRasterProducer. The document's contents are derived from the specified parameter list, and depend on the concrete subclass' implementation. This returns null if the parameter list is null, or if the configuration document cannot be created for any reason.
        Parameters:
        params - the parameters which describe the configuration document's contents.
        Returns:
        the configuration document, or null if the parameter list is null or does not contain the required parameters.
      • installConfigFile

        protected void installConfigFile​(AVList params)
                                  throws java.lang.Exception
        Installs the configuration file which describes the tiled data produced by this TiledRasterProducer. The install location, configuration filename, and configuration file contents are derived from the specified parameter list. This throws an exception if the configuration file cannot be installed for any reason.

        The parameter list must contain at least the following keys:

        Required Keys
        Key
        AVKey.FILE_STORE_LOCATION
        AVKey.DATA_CACHE_NAME
        AVKey.DATASET_NAME
        Parameters:
        params - the parameters which describe the install location, the configuration filename, and the configuration file contents.
        Throws:
        java.lang.Exception - if the configuration file cannot be installed for any reason.
        java.lang.IllegalArgumentException - if the parameter list is null.
      • getConfigFileInstallLocation

        protected java.io.File getConfigFileInstallLocation​(AVList params)
        Returns the location of the configuration file which describes the tiled data produced by this TiledRasterProducer. The install location is derived from the specified parameter list. This returns null if the parameter list is null, or if it does not contain any of the following keys:
        Required Keys
        Key
        AVKey.FILE_STORE_LOCATION
        AVKey.DATA_CACHE_NAME
        AVKey.DATASET_NAME
        Parameters:
        params - the parameters which describe the install location.
        Returns:
        the configuration file install location, or null if the parameter list is null or does not contain the required parameters.
      • installRasterServerConfigFile

        protected void installRasterServerConfigFile​(AVList productionParams)
      • appendProperties

        protected void appendProperties​(org.w3c.dom.Element context,
                                        AVList properties)
      • calculateTileCount

        protected void calculateTileCount​(LevelSet levelSet,
                                          AVList params)
      • startProgress

        protected void startProgress()
      • updateProgress

        protected void updateProgress()