/** * Start a new {@link BulkRetrievalThread} that downloads all placenames for a given sector and * resolution to a specified file store. * * <p>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 {@link * PlaceNameLayerBulkDownloader}. * * <p>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. * * @param sector the sector to download data for. * @param resolution the target resolution, provided in radians of latitude per texel. * @param fileStore the file store in which to place the downloaded elevations. If null the * current World Wind file cache is used. * @param listener an optional retrieval listener. May be null. * @return the {@link PlaceNameLayerBulkDownloader} that executes the retrieval. * @throws IllegalArgumentException if the sector is null or the resolution is less than zero. * @see PlaceNameLayerBulkDownloader */ public BulkRetrievalThread makeLocal( Sector sector, double resolution, FileStore fileStore, BulkRetrievalListener listener) { PlaceNameLayerBulkDownloader thread = new PlaceNameLayerBulkDownloader(this, sector, resolution, fileStore, listener); thread.setDaemon(true); thread.start(); return thread; }
/** * Get the estimated size in bytes of the placenames not in a specified file store for the given * sector and resolution. * * <p>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. * * @param sector the sector to estimate. * @param resolution the target resolution, provided in radians of latitude per texel. * @param fileStore the file store to examine. If null the current World Wind file cache is used. * @return the estimated size in byte of the missing placenames. * @throws IllegalArgumentException if the sector is null or the resolution is less than zero. */ public long getEstimatedMissingDataSize(Sector sector, double resolution, FileStore fileStore) { try { PlaceNameLayerBulkDownloader downloader = new PlaceNameLayerBulkDownloader( this, sector, resolution, fileStore != null ? fileStore : this.getDataFileStore(), null); return downloader.getEstimatedMissingDataSize(); } catch (Exception e) { String message = Logging.getMessage("generic.ExceptionDuringDataSizeEstimate", this.getName()); Logging.logger().severe(message); throw new RuntimeException(message); } }