Class BasicTiledImageLayerBulkDownloader

  • All Implemented Interfaces:
    java.lang.Runnable

    public class BasicTiledImageLayerBulkDownloader
    extends BulkRetrievalThread
    Downloads imagery not currently available in the WorldWind file cache or a specified file store. The class derives from Thread and is meant to operate in its own thread.

    The sector and resolution associated with the downloader are specified during construction and are final.

    • Constructor Detail

      • BasicTiledImageLayerBulkDownloader

        public BasicTiledImageLayerBulkDownloader​(BasicTiledImageLayer layer,
                                                  Sector sector,
                                                  double resolution,
                                                  BulkRetrievalListener listener)
        Constructs a downloader to retrieve imagery not currently available in the WorldWind file cache.

        The thread returned is not started during construction, the caller must start the thread.

        Parameters:
        layer - the layer for which to download imagery.
        sector - the sector to download data for. This value is final.
        resolution - the target resolution, provided in radians of latitude per texel. This value is final.
        listener - an optional retrieval listener. May be null.
        Throws:
        java.lang.IllegalArgumentException - if either the layer or sector are null, or the resolution is less than zero.
      • BasicTiledImageLayerBulkDownloader

        public BasicTiledImageLayerBulkDownloader​(BasicTiledImageLayer layer,
                                                  Sector sector,
                                                  double resolution,
                                                  FileStore fileStore,
                                                  BulkRetrievalListener listener)
        Constructs a downloader to retrieve imagery not currently available in a specified file store.

        The thread returned is not started during construction, the caller must start the thread.

        Parameters:
        layer - the layer for which to download imagery.
        sector - the sector to download data for. This value is final.
        resolution - the target resolution, provided in radians of latitude per texel. This value is final.
        fileStore - the file store in which to place the downloaded elevations.
        listener - an optional retrieval listener. May be null.
        Throws:
        java.lang.IllegalArgumentException - if either the layer, the sector or file store are null, or the resolution is less than zero.
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Specified by:
        run in class BulkRetrievalThread
      • submitMissingTilesRequests

        protected void submitMissingTilesRequests()
                                           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • callRetrievalListeners

        protected void callRetrievalListeners​(Retriever retriever,
                                              TextureTile tile)
      • removeRetrievedTile

        protected void removeRetrievedTile​(TextureTile tile)
      • removeAbsentTile

        protected void removeAbsentTile​(TextureTile tile)
      • normalizeProgress

        protected void normalizeProgress()
      • getEstimatedMissingDataSize

        protected long getEstimatedMissingDataSize()
        Get the estimated size in byte of the missing imagery for the object's Sector, resolution and file store. Note that the target resolution must be provided in radian latitude per texel - which is the resolution in meter divided by the globe radius.
        Returns:
        the estimated size in byte of the missing imagery.
      • estimateMissingTilesCount

        protected long estimateMissingTilesCount​(int numSamples)
      • computeRegionDivisions

        protected int computeRegionDivisions​(Sector sector,
                                             int levelNumber,
                                             int maxCount)
      • computeRandomRegions

        protected Sector[] computeRandomRegions​(Sector sector,
                                                int div,
                                                int numRegions)
      • getRegionIterator

        protected java.util.Iterator<Sector> getRegionIterator​(Sector sector,
                                                               int div)
      • getMissingTilesInSector

        protected java.util.ArrayList<TextureTile> getMissingTilesInSector​(Sector sector,
                                                                           int levelNumber)
                                                                    throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • isTileLocalOrAbsent

        protected boolean isTileLocalOrAbsent​(TextureTile tile)
      • estimateAverageTileSize

        protected long estimateAverageTileSize()
      • computeAverageTileSize

        protected long computeAverageTileSize​(java.io.File dir)