Class PlaceNameLayer

    • Constructor Detail

      • PlaceNameLayer

        public PlaceNameLayer​(PlaceNameServiceSet placeNameServiceSet)
        Parameters:
        placeNameServiceSet - the set of PlaceNameService objects that PlaceNameLayer will render.
        Throws:
        java.lang.IllegalArgumentException - if PlaceNameServiceSet is null
    • Method Detail

      • getRequestQ

        protected java.util.concurrent.PriorityBlockingQueue<java.lang.Runnable> getRequestQ()
      • computeReferencePoint

        protected Vec4 computeReferencePoint​(DrawContext dc)
      • getReferencePoint

        protected Vec4 getReferencePoint()
      • drawOrRequestTile

        protected void drawOrRequestTile​(DrawContext dc,
                                         PlaceNameLayer.Tile tile,
                                         double minDisplayDistanceSquared,
                                         double maxDisplayDistanceSquared)
      • isSectorVisible

        protected static boolean isSectorVisible​(DrawContext dc,
                                                 Sector sector,
                                                 double minDistanceSquared,
                                                 double maxDistanceSquared)
      • isTileVisible

        protected static boolean isTileVisible​(DrawContext dc,
                                               PlaceNameLayer.Tile tile,
                                               double minDistanceSquared,
                                               double maxDistanceSquared)
      • sendRequests

        protected void sendRequests()
      • newCharBuffer

        protected static java.nio.CharBuffer newCharBuffer​(int numElements)
      • saveBuffer

        protected void saveBuffer​(java.nio.ByteBuffer buffer,
                                  java.io.File outFile)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • makeLocal

        public BulkRetrievalThread makeLocal​(Sector sector,
                                             double resolution,
                                             BulkRetrievalListener listener)
        Start a new BulkRetrievalThread that downloads all placenames for a given sector and resolution to the current WorldWind file 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 PlaceNameLayerBulkDownloader.

        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.
        listener - an optional retrieval listener. May be null.
        Returns:
        the PlaceNameLayerBulkDownloader that executes the retrieval.
        Throws:
        java.lang.IllegalArgumentException - if the sector is null or the resolution is less than zero.
        See Also:
        PlaceNameLayerBulkDownloader
      • makeLocal

        public BulkRetrievalThread makeLocal​(Sector sector,
                                             double resolution,
                                             FileStore fileStore,
                                             BulkRetrievalListener listener)
        Start a new BulkRetrievalThread that downloads all placenames for a given sector and resolution to a specified 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 PlaceNameLayerBulkDownloader.

        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 elevations. If null the current WorldWind file cache is used.
        listener - an optional retrieval listener. May be null.
        Returns:
        the PlaceNameLayerBulkDownloader that executes the retrieval.
        Throws:
        java.lang.IllegalArgumentException - if the sector is null or the resolution is less than zero.
        See Also:
        PlaceNameLayerBulkDownloader
      • getEstimatedMissingDataSize

        public long getEstimatedMissingDataSize​(Sector sector,
                                                double resolution)
        Get the estimated size in bytes of the placenames 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 placenames.
        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 placenames not in a specified file store 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.
        fileStore - the file store to examine. If null the current WorldWind file cache is used.
        Returns:
        the estimated size in byte of the missing placenames.
        Throws:
        java.lang.IllegalArgumentException - if the sector is null or the resolution is less than zero.