Class BasicTiledImageLayer

    • Field Detail

      • fileLock

        protected final java.lang.Object fileLock
      • RESOURCE_ID_OGC_CAPABILITIES

        protected static final int RESOURCE_ID_OGC_CAPABILITIES
        See Also:
        Constant Field Values
    • Constructor Detail

      • BasicTiledImageLayer

        public BasicTiledImageLayer​(LevelSet levelSet)
      • BasicTiledImageLayer

        public BasicTiledImageLayer​(AVList params)
      • BasicTiledImageLayer

        public BasicTiledImageLayer​(org.w3c.dom.Document dom,
                                    AVList params)
      • BasicTiledImageLayer

        public BasicTiledImageLayer​(org.w3c.dom.Element domElement,
                                    AVList params)
      • BasicTiledImageLayer

        public BasicTiledImageLayer​(java.lang.String restorableStateInXml)
    • Method Detail

      • getParamsFromDocument

        protected static AVList getParamsFromDocument​(org.w3c.dom.Element domElement,
                                                      AVList params)
      • setFallbacks

        protected static void setFallbacks​(AVList params)
      • isTextureFileExpired

        protected boolean isTextureFileExpired​(TextureTile tile,
                                               java.net.URL textureURL,
                                               FileStore fileStore)
      • loadTexture

        protected boolean loadTexture​(TextureTile tile,
                                      java.net.URL textureURL)
      • readTexture

        protected com.jogamp.opengl.util.texture.TextureData readTexture​(java.net.URL url,
                                                                         java.lang.String textureFormat,
                                                                         boolean useMipMaps)
        Reads and returns the texture data at the specified URL, optionally converting it to the specified format and generating mip-maps. If textureFormat is a recognized mime type, this returns the texture data in the specified format. Otherwise, this returns the texture data in its native format. If useMipMaps is true, this generates mip maps for any non-DDS texture data, and uses any mip-maps contained in DDS texture data.

        Supported texture formats are as follows:

        • image/dds - Returns DDS texture data, converting the data to DDS if necessary. If the data is already in DDS format it's returned as-is.
        Parameters:
        url - the URL referencing the texture data to read.
        textureFormat - the texture data format to return.
        useMipMaps - true to generate mip-maps for the texture data or use mip maps already in the texture data, and false to read the texture data without generating or using mip-maps.
        Returns:
        TextureData the texture data from the specified URL, in the specified format and with mip-maps.
      • addTileToCache

        protected void addTileToCache​(TextureTile tile)
      • makeLocal

        public BulkRetrievalThread makeLocal​(Sector sector,
                                             double resolution,
                                             BulkRetrievalListener listener)
        Start a new BulkRetrievalThread that downloads all imagery for a given sector and resolution to the current WorldWind file cache, without downloading imagery that is already in the cache.

        This method creates and starts a thread to perform the download. A reference to the thread is returned. To create a downloader that has not been started, construct a BasicTiledImageLayerBulkDownloader.

        Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.

        Specified by:
        makeLocal in interface BulkRetrievable
        Parameters:
        sector - the sector to download imagery for.
        resolution - the target resolution, provided in radians of latitude per texel.
        listener - an optional retrieval listener. May be null.
        Returns:
        the BulkRetrievalThread executing the retrieval or null if the specified sector does not intersect the layer bounding sector.
        Throws:
        java.lang.IllegalArgumentException - if the sector is null or the resolution is less than zero.
        See Also:
        BasicTiledImageLayerBulkDownloader
      • makeLocal

        public BulkRetrievalThread makeLocal​(Sector sector,
                                             double resolution,
                                             FileStore fileStore,
                                             BulkRetrievalListener listener)
        Start a new BulkRetrievalThread that downloads all imagery for a given sector and resolution to a specified FileStore, without downloading imagery that is already in the file store.

        This method creates and starts a thread to perform the download. A reference to the thread is returned. To create a downloader that has not been started, construct a BasicTiledImageLayerBulkDownloader.

        Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.

        Specified by:
        makeLocal in interface BulkRetrievable
        Parameters:
        sector - the sector to download data for.
        resolution - the target resolution, provided in radians of latitude per texel.
        fileStore - the file store in which to place the downloaded imagery. If null the current WorldWind file cache is used.
        listener - an optional retrieval listener. May be null.
        Returns:
        the BulkRetrievalThread executing the retrieval or null if the specified sector does not intersect the layer bounding sector.
        Throws:
        java.lang.IllegalArgumentException - if the sector is null or the resolution is less than zero.
        See Also:
        BasicTiledImageLayerBulkDownloader
      • getEstimatedMissingDataSize

        public long getEstimatedMissingDataSize​(Sector sector,
                                                double resolution)
        Get the estimated size in bytes of the imagery not in the WorldWind file cache for the given sector and resolution.

        Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.

        Specified by:
        getEstimatedMissingDataSize in interface BulkRetrievable
        Parameters:
        sector - the sector to estimate.
        resolution - the target resolution, provided in radians of latitude per texel.
        Returns:
        the estimated size in bytes of the missing imagery.
        Throws:
        java.lang.IllegalArgumentException - if the sector is null or the resolution is less than zero.
      • getEstimatedMissingDataSize

        public long getEstimatedMissingDataSize​(Sector sector,
                                                double resolution,
                                                FileStore fileStore)
        Get the estimated size in bytes of the imagery not in a specified file store for a specified sector and resolution.

        Note that the target resolution must be provided in radians of latitude per texel, which is the resolution in meters divided by the globe radius.

        Specified by:
        getEstimatedMissingDataSize in interface BulkRetrievable
        Parameters:
        sector - the sector to estimate.
        resolution - the target resolution, provided in radians of latitude per texel.
        fileStore - the file store to examine. If null the current WorldWind file cache is used.
        Returns:
        the estimated size in byte of the missing imagery.
        Throws:
        java.lang.IllegalArgumentException - if the sector is null or the resolution is less than zero.
      • retrieveResources

        protected java.lang.String retrieveResources()
        Retrieves any non-tile resources associated with this Layer, either online or in the local filesystem, and initializes properties of this Layer using those resources. This returns a key indicating the retrieval state: AVKey.RETRIEVAL_STATE_SUCCESSFUL indicates the retrieval succeeded, AVKey.RETRIEVAL_STATE_ERROR indicates the retrieval failed with errors, and null indicates the retrieval state is unknown. This method may invoke blocking I/O operations, and therefore should not be executed from the rendering thread.
        Returns:
        AVKey.RETRIEVAL_STATE_SUCCESSFUL if the retrieval succeeded, AVKey.RETRIEVAL_STATE_ERROR if the retrieval failed with errors, and null if the retrieval state is unknown.
      • initFromOGCCapabilitiesResource

        protected void initFromOGCCapabilitiesResource​(WMSCapabilities caps,
                                                       AVList params)
        Initializes this Layer's expiry time property from the specified WMS Capabilities document and parameter list describing the WMS layer names associated with this Layer. This method is thread safe; it synchronizes changes to this Layer by wrapping the appropriate method calls in SwingUtilities.invokeLater(Runnable).
        Parameters:
        caps - the WMS Capabilities document retrieved from this Layer's WMS server.
        params - the parameter list describing the WMS layer names associated with this Layer.
        Throws:
        java.lang.IllegalArgumentException - if either the Capabilities or the parameter list is null.
      • isRetrieveResources

        protected boolean isRetrieveResources()
        Returns a boolean value indicating if this Layer should retrieve any non-tile resources, either online or in the local filesystem, and initialize itself using those resources.
        Returns:
        true if this Layer should retrieve any non-tile resources, and false otherwise.
      • startResourceRetrieval

        protected void startResourceRetrieval()
        Starts retrieving non-tile resources associated with this Layer in a non-rendering thread.
      • writeConfigurationFile

        protected void writeConfigurationFile​(FileStore fileStore)
      • writeConfigurationParams

        protected void writeConfigurationParams​(FileStore fileStore,
                                                AVList params)
      • doWriteConfigurationParams

        protected void doWriteConfigurationParams​(FileStore fileStore,
                                                  java.lang.String fileName,
                                                  AVList params)
      • needsConfigurationFile

        protected boolean needsConfigurationFile​(FileStore fileStore,
                                                 java.lang.String fileName,
                                                 AVList params,
                                                 boolean removeIfExpired)
      • getConfigurationParams

        protected AVList getConfigurationParams​(AVList params)
      • createConfigurationDocument

        protected org.w3c.dom.Document createConfigurationDocument​(AVList params)
      • getRestorableState

        public java.lang.String getRestorableState()
        Description copied from interface: Restorable
        Returns an XML document string describing the object's state. This state can be restored later by calling restoreState and passing the XML document.
        Specified by:
        getRestorableState in interface Restorable
        Overrides:
        getRestorableState in class AbstractLayer
        Returns:
        an XML document string describing the object's state.
      • restoreState

        public void restoreState​(java.lang.String stateInXml)
        Description copied from interface: Restorable
        Restores the object's state to what is described in the specified XML document string.
        Specified by:
        restoreState in interface Restorable
        Overrides:
        restoreState in class AbstractLayer
        Parameters:
        stateInXml - an XML document string describing an object's state.
      • restorableStateToParams

        protected static AVList restorableStateToParams​(java.lang.String stateInXml)