Package gov.nasa.worldwind.wms
Class WMSTiledImageLayer
- java.lang.Object
-
- All Implemented Interfaces:
AVList
,Disposable
,MessageListener
,Layer
,Restorable
,BulkRetrievable
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
BMNGWMSLayer
,CountryBoundariesLayer
,LandsatI3WMSLayer
,USDANAIPWMSImageLayer
,USGSTopoHighRes
,USGSTopoLowRes
,USGSTopoMedRes
public class WMSTiledImageLayer extends BasicTiledImageLayer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
WMSTiledImageLayer.ComposeImageTile
static class
WMSTiledImageLayer.URLBuilder
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.BasicTiledImageLayer
BasicTiledImageLayer.DownloadPostProcessor, BasicTiledImageLayer.RequestTask
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.TiledImageLayer
TiledImageLayer.CompositionRetrievalPostProcessor, TiledImageLayer.LevelComparer
-
-
Field Summary
-
Fields inherited from class gov.nasa.worldwind.layers.BasicTiledImageLayer
fileLock, RESOURCE_ID_OGC_CAPABILITIES
-
Fields inherited from class gov.nasa.worldwind.layers.TiledImageLayer
atMaxResolution, currentResourceTile, currentTiles, detailHint, detailHintOrigin, drawBoundingVolumes, drawTileBoundaries, forceLevelZeroLoads, levelComparer, levels, levelZeroLoaded, requestQ, retainLevelZeroTiles, supportedImageFormats, textureFormat, tileCountName, topLevels, useMipMaps, useTransparentTextures
-
-
Constructor Summary
Constructors Constructor Description WMSTiledImageLayer(AVList params)
WMSTiledImageLayer(WMSCapabilities caps, AVList params)
WMSTiledImageLayer(java.lang.String stateInXml)
WMSTiledImageLayer(org.w3c.dom.Document dom, AVList params)
WMSTiledImageLayer(org.w3c.dom.Element domElement, AVList params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImage
composeImageForSector(Sector sector, int canvasWidth, int canvasHeight, double aspectRatio, int levelNumber, java.lang.String mimeType, boolean abortOnError, java.awt.image.BufferedImage image, int timeout)
Create an image for the portion of this layer lying within a specified sector.The image is created at a specified aspect ratio within a canvas of a specified size.protected org.w3c.dom.Document
createConfigurationDocument(AVList params)
Appends WMS tiled image layer configuration elements to the superclass configuration document.void
getRestorableStateForAVPair(java.lang.String key, java.lang.Object value, RestorableSupport rs, RestorableSupport.StateObject context)
protected static void
legacyWmsRestoreStateToParams(RestorableSupport rs, RestorableSupport.StateObject context, AVList params)
static AVList
wmsGetParamsFromCapsDoc(WMSCapabilities caps, AVList params)
Extracts parameters necessary to configure the layer from a WMS capabilities document.protected static AVList
wmsGetParamsFromDocument(org.w3c.dom.Element domElement, AVList params)
Extracts parameters necessary to configure the layer from an XML DOM element.static AVList
wmsRestorableStateToParams(java.lang.String stateInXml)
Creates an attribute-value list from an xml document containing restorable state for this layer.protected static void
wmsRestoreStateToParams(RestorableSupport rs, RestorableSupport.StateObject context, AVList params)
-
Methods inherited from class gov.nasa.worldwind.layers.BasicTiledImageLayer
addTileToCache, createDownloadPostProcessor, createRequestTask, doGetRestorableState, doRestoreState, doRestoreStateForObject, doWriteConfigurationParams, forceTextureLoad, getConfigurationParams, getEstimatedMissingDataSize, getEstimatedMissingDataSize, getParamsFromDocument, getRestorableState, initFromOGCCapabilitiesResource, isRetrieveResources, isTextureFileExpired, loadTexture, makeLocal, makeLocal, needsConfigurationFile, readTexture, requestTexture, restorableStateToParams, restoreState, restoreStateForParams, retrieveLocalTexture, retrieveRemoteTexture, retrieveResources, retrieveTexture, setFallbacks, startResourceRetrieval, writeConfigurationFile, writeConfigurationParams
-
Methods inherited from class gov.nasa.worldwind.layers.TiledImageLayer
addTile, addTileOrDescendants, addTileToCurrent, assembleTiles, atMaxLevel, checkTextureExpiration, computeLevelForResolution, computeReferencePoint, countImagesInSector, countImagesInSector, createTiledImageLayerConfigDocument, createTiledImageLayerConfigElements, createTopLevelTiles, doRender, downloadImage, draw, drawBoundingVolumes, drawTileIDs, getAvailableImageFormats, getDefaultImageFormat, getDetailFactor, getDetailHint, getImage, getLegacyTiledImageLayerConfigParams, getLevels, getMaxEffectiveAltitude, getMinEffectiveAltitude, getReferencePoint, getRequestQ, getTextureFormat, getTiledImageLayerConfigParams, getTilesInSector, getTopLevels, getValue, isAtMaxResolution, isDrawBoundingVolumes, isDrawTileBoundaries, isDrawTileIDs, isForceLevelZeroLoads, isImageFormatAvailable, isLayerInView, isMultiResolution, isRetainLevelZeroTiles, isTileVisible, isUseMipMaps, isUseTransparentTextures, loadAllTopLevelTextures, meetsRenderCriteria, needToSplit, render, requestImage, retrieveLocalImage, retrieveRemoteImage, sendRequests, setAvailableImageFormats, setBlendingFunction, setDetailHint, setDrawBoundingVolumes, setDrawTileBoundaries, setDrawTileIDs, setExpiryTime, setForceLevelZeroLoads, setName, setRetainLevelZeroTiles, setTextureFormat, setUseMipMaps, setUseTransparentTextures, setValue
-
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPick, doPreRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getScale, getScreenCredit, isEnabled, isLayerActive, isLayerConfigDocument, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, setDataFileStore, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, toString
-
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, getStringValue, getStringValue, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValues
-
Methods inherited from interface gov.nasa.worldwind.retrieve.BulkRetrievable
getName
-
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Constructor Detail
-
WMSTiledImageLayer
public WMSTiledImageLayer(AVList params)
-
WMSTiledImageLayer
public WMSTiledImageLayer(org.w3c.dom.Document dom, AVList params)
-
WMSTiledImageLayer
public WMSTiledImageLayer(org.w3c.dom.Element domElement, AVList params)
-
WMSTiledImageLayer
public WMSTiledImageLayer(WMSCapabilities caps, AVList params)
-
WMSTiledImageLayer
public WMSTiledImageLayer(java.lang.String stateInXml)
-
-
Method Detail
-
wmsGetParamsFromDocument
protected static AVList wmsGetParamsFromDocument(org.w3c.dom.Element domElement, AVList params)
Extracts parameters necessary to configure the layer from an XML DOM element.- Parameters:
domElement
- the element to search for parameters.params
- an attribute-value list in which to place the extracted parameters. May be null, in which case a new attribue-value list is created and returned.- Returns:
- the attribute-value list passed as the second parameter, or the list created if the second parameter is null.
- Throws:
java.lang.IllegalArgumentException
- if the DOM element is null.
-
wmsGetParamsFromCapsDoc
public static AVList wmsGetParamsFromCapsDoc(WMSCapabilities caps, AVList params)
Extracts parameters necessary to configure the layer from a WMS capabilities document.- Parameters:
caps
- the capabilities document.params
- an attribute-value list in which to place the extracted parameters. May be null, in which case a new attribute-value list is created and returned.- Returns:
- the attribute-value list passed as the second parameter, or the list created if the second parameter is null.
- Throws:
java.lang.IllegalArgumentException
- if the capabilities document reference is null.
-
composeImageForSector
public java.awt.image.BufferedImage composeImageForSector(Sector sector, int canvasWidth, int canvasHeight, double aspectRatio, int levelNumber, java.lang.String mimeType, boolean abortOnError, java.awt.image.BufferedImage image, int timeout) throws java.lang.Exception
Description copied from class:TiledImageLayer
Create an image for the portion of this layer lying within a specified sector.The image is created at a specified aspect ratio within a canvas of a specified size. This returns the specified image if this layer has no content in the specified sector.- Overrides:
composeImageForSector
in classTiledImageLayer
- Parameters:
sector
- the sector of interest.canvasWidth
- the width of the canvas.canvasHeight
- the height of the canvas.aspectRatio
- the aspect ratio, width/height, of the window. If the aspect ratio is greater or equal to one, the full width of the canvas is used for the image; the height used is proportional to the inverse of the aspect ratio. If the aspect ratio is less than one, the full height of the canvas is used, and the width used is proportional to the aspect ratio.levelNumber
- the target level of the tiled image layer.mimeType
- the type of image to create, e.g., "png" and "jpg".abortOnError
- indicates whether to stop assembling the image if an error occurs. If false, processing continues until all portions of the layer that intersect the specified sector have been added to the image. Portions for which an error occurs will be blank.image
- if non-null, aBufferedImage
in which to place the image. If null, a new buffered image is created. The image must be the width and height specified in thecanvasWidth
andcanvasHeight
arguments.timeout
- The amount of time to allow for reading the image from the server.- Returns:
- image the assembled image, of size indicated by the
canvasWidth
andcanvasHeight
. If the specified aspect ratio is one, all pixels contain values. If the aspect ratio is greater than one, a full-width segment along the top of the canvas is blank. If the aspect ratio is less than one, a full-height segment along the right side of the canvase is blank. If theimage
argument was non-null, that buffered image is returned. - Throws:
java.lang.IllegalArgumentException
- ifsector
is null.java.lang.Exception
- Other errors.- See Also:
;
-
createConfigurationDocument
protected org.w3c.dom.Document createConfigurationDocument(AVList params)
Appends WMS tiled image layer configuration elements to the superclass configuration document.- Overrides:
createConfigurationDocument
in classBasicTiledImageLayer
- Parameters:
params
- configuration parameters describing this WMS tiled image layer.- Returns:
- a WMS tiled image layer configuration document.
-
getRestorableStateForAVPair
public void getRestorableStateForAVPair(java.lang.String key, java.lang.Object value, RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
getRestorableStateForAVPair
in classBasicTiledImageLayer
-
wmsRestorableStateToParams
public static AVList wmsRestorableStateToParams(java.lang.String stateInXml)
Creates an attribute-value list from an xml document containing restorable state for this layer.- Parameters:
stateInXml
- an xml document specified in aString
.- Returns:
- an attribute-value list containing the parameters in the specified restorable state.
- Throws:
java.lang.IllegalArgumentException
- if the state reference is null.
-
wmsRestoreStateToParams
protected static void wmsRestoreStateToParams(RestorableSupport rs, RestorableSupport.StateObject context, AVList params)
-
legacyWmsRestoreStateToParams
protected static void legacyWmsRestoreStateToParams(RestorableSupport rs, RestorableSupport.StateObject context, AVList params)
-
-