Class TiledRasterProducer
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.data.AbstractDataStoreProducer
-
- gov.nasa.worldwind.data.TiledRasterProducer
-
- All Implemented Interfaces:
AVList
,DataStoreProducer
,MessageListener
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
TiledElevationProducer
,TiledImageProducer
public abstract class TiledRasterProducer extends AbstractDataStoreProducer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.data.AbstractDataStoreProducer
AbstractDataStoreProducer.SourceInfo
-
-
Field Summary
-
Fields inherited from class gov.nasa.worldwind.data.AbstractDataStoreProducer
productionParams
-
-
Constructor Summary
Constructors Constructor Description TiledRasterProducer()
TiledRasterProducer(MemoryCache cache, int writeThreadPoolSize)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
appendProperties(org.w3c.dom.Element context, AVList properties)
protected void
appendSource(org.w3c.dom.Element sources, CachedDataRaster raster)
protected void
assembleDataRasters()
protected void
assembleDataSource(java.lang.Object source, AVList params)
protected void
calculateTileCount(LevelSet levelSet, AVList params)
protected Sector
computeBoundingSector(java.lang.Iterable<? extends DataRaster> rasters)
protected LatLon
computeDesiredTileDelta(Sector sector)
protected LatLon
computeIntegralLevelZeroTileDelta(LatLon originalDelta)
protected int
computeNumLevels(LatLon levelZeroDelta, LatLon lastLevelDelta)
protected LatLon
computeRasterPixelSize(DataRaster raster)
protected LatLon
computeRasterTileDelta(int tileWidth, int tileHeight, java.lang.Iterable<? extends DataRaster> rasters)
protected LatLon
computeSmallestPixelSize(java.lang.Iterable<? extends DataRaster> rasters)
protected abstract org.w3c.dom.Document
createConfigDoc(AVList params)
Returns a configuration document which describes the tiled data produced by this TiledRasterProducer.protected abstract DataRaster
createDataRaster(int width, int height, Sector sector, AVList params)
protected static MemoryCache
createDefaultCache()
protected java.util.concurrent.ExecutorService
createDefaultTileWriteService(int threadPoolSize)
protected Tile[]
createSubTiles(Tile tile, Level nextLevel)
protected DataRaster
createTileRaster(LevelSet levelSet, Tile tile, AVList params)
protected void
doStartProduction(AVList parameters)
protected DataRaster
drawDataSources(LevelSet levelSet, Tile tile, java.lang.Iterable<DataRaster> dataRasters, AVList params)
protected DataRaster
drawDescendants(LevelSet levelSet, Tile tile, AVList params)
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.protected java.lang.Object
findWriterFor(DataRaster raster, java.lang.String formatSuffix, java.io.File destination, DataRasterWriter[] writers)
protected MemoryCache
getCache()
protected java.io.File
getConfigFileInstallLocation(AVList params)
Returns the location of the configuration file which describes the tiled data produced by this TiledRasterProducer.protected abstract DataRasterReader[]
getDataRasterReaders()
java.lang.Iterable<DataRaster>
getDataRasters()
protected abstract DataRasterWriter[]
getDataRasterWriters()
java.lang.String
getDataSourceDescription()
protected DataRasterReaderFactory
getReaderFactory()
protected java.util.concurrent.Semaphore
getTileWriteSemaphore()
protected java.util.concurrent.ExecutorService
getTileWriteService()
protected void
initLevelSetParameters(AVList params)
protected abstract void
initProductionParameters(AVList params)
protected void
installConfigFile(AVList params)
Installs the configuration file which describes the tiled data produced by this TiledRasterProducer.protected void
installLevelSet(LevelSet levelSet, AVList params)
protected java.io.File
installLocationFor(AVList params)
protected java.lang.Object
installLocationForTile(AVList installParams, Tile tile)
protected void
installRasterServerConfigFile(AVList productionParams)
protected void
installTileRaster(Tile tile, DataRaster tileRaster, AVList params)
protected void
installTileRasterComplete()
protected void
installTileRasterLater(LevelSet levelSet, Tile tile, DataRaster tileRaster, AVList params)
protected boolean
isDataSetLarge(java.lang.Iterable<? extends DataRaster> rasters, int largeThreshold)
protected boolean
isFinalLevel(LevelSet levelSet, int levelNumber, AVList params)
protected boolean
isWithinLatLonLimits(Sector sector, LatLon tileDelta, LatLon tileOrigin)
void
removeProductionState()
protected void
startProgress()
protected void
updateProgress()
protected java.lang.String
validateProductionParameters(AVList parameters)
protected void
waitForInstallTileTasks()
-
Methods inherited from class gov.nasa.worldwind.data.AbstractDataStoreProducer
acceptsDataSource, containsDataSource, getDataSourceList, getDataSources, getProductionParameters, getProductionResults, getProductionResultsList, getStoreParameters, isStopped, offerAllDataSources, offerDataSource, removeAllDataSources, removeDataSource, setStoreParameters, startProduction, stopProduction, validateDataSource
-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Constructor Detail
-
TiledRasterProducer
public TiledRasterProducer(MemoryCache cache, int writeThreadPoolSize)
-
TiledRasterProducer
public TiledRasterProducer()
-
-
Method Detail
-
getDataRasters
public java.lang.Iterable<DataRaster> getDataRasters()
-
getReaderFactory
protected DataRasterReaderFactory getReaderFactory()
-
getDataSourceDescription
public java.lang.String getDataSourceDescription()
-
removeProductionState
public void removeProductionState()
- Specified by:
removeProductionState
in interfaceDataStoreProducer
- Overrides:
removeProductionState
in classAbstractDataStoreProducer
-
createDataRaster
protected abstract DataRaster createDataRaster(int width, int height, Sector sector, AVList params)
-
getDataRasterReaders
protected abstract DataRasterReader[] getDataRasterReaders()
-
getDataRasterWriters
protected abstract DataRasterWriter[] getDataRasterWriters()
-
getCache
protected MemoryCache getCache()
-
getTileWriteService
protected java.util.concurrent.ExecutorService getTileWriteService()
-
getTileWriteSemaphore
protected java.util.concurrent.Semaphore getTileWriteSemaphore()
-
doStartProduction
protected void doStartProduction(AVList parameters) throws java.lang.Exception
- Specified by:
doStartProduction
in classAbstractDataStoreProducer
- Throws:
java.lang.Exception
-
validateProductionParameters
protected java.lang.String validateProductionParameters(AVList parameters)
- Specified by:
validateProductionParameters
in classAbstractDataStoreProducer
-
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)
-
computeRasterPixelSize
protected LatLon computeRasterPixelSize(DataRaster raster)
-
computeSmallestPixelSize
protected LatLon computeSmallestPixelSize(java.lang.Iterable<? extends DataRaster> rasters)
-
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
-
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 requiresmaxNumOfLevels
- 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 tomaxNumOfLevels
.- Parameters:
params
- AVList that may contain AVKey.TILED_RASTER_PRODUCER_LIMIT_MAX_LEVEL propertymaxNumOfLevels
- 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)
-
installTileRasterLater
protected void installTileRasterLater(LevelSet levelSet, Tile tile, DataRaster tileRaster, AVList params)
-
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)
-
appendSource
protected void appendSource(org.w3c.dom.Element sources, CachedDataRaster raster) throws WWRuntimeException
- Throws:
WWRuntimeException
-
startProgress
protected void startProgress()
-
updateProgress
protected void updateProgress()
-
-