Package gov.nasa.worldwind.util
Class DataConfigurationUtils
- java.lang.Object
-
- gov.nasa.worldwind.util.DataConfigurationUtils
-
public class DataConfigurationUtils extends java.lang.Object
A collection of static methods useful for opening, reading, and otherwise working with WorldWind data configuration documents.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
DATE_TIME_PATTERN
protected static java.lang.String
DEFAULT_TEXTURE_FORMAT
-
Constructor Summary
Constructors Constructor Description DataConfigurationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static java.lang.String
chooseImageFormat(java.lang.Object[] formats, java.lang.String[] formatOrderPreference)
static org.w3c.dom.Document
convertToStandardDataConfigDocument(org.w3c.dom.Document doc)
Returns the specified data configuration document transformed to a standard Layer or ElevationModel configuration document.static org.w3c.dom.Element
createLevelSetConfigElements(AVList params, org.w3c.dom.Element context)
Appends LevelSet configuration parameters as elements to the specified context.static java.util.concurrent.ScheduledExecutorService
createResourceRetrievalService(java.lang.String threadName)
Convenience method to create aScheduledExecutorService
which can be used by World Wind components to schedule periodic resource checks.static org.w3c.dom.Element
createWCSLayerConfigElements(AVList params, org.w3c.dom.Element context)
Appends WCS layer parameters as elements to a specified context.static org.w3c.dom.Element
createWMSLayerConfigElements(AVList params, org.w3c.dom.Element context)
Appends WMS layer parameters as elements to a specified context.static java.net.URL
findExistingDataConfigFile(FileStore fileStore, java.lang.String fileName)
Returns the URL of an existing data configuration file under the specified file store, or null if no configuration file exists.static AVList
getDataConfigCacheName(java.lang.String dataConfigCachePath, AVList params)
Convenience method for computing a data configuration file's cache name in a FileStore, given the file's cache path.static java.lang.String
getDataConfigDisplayName(org.w3c.dom.Element domElement)
Returns the specified data configuration document's display name as a string, or null if the document is not one of the recognized types.static java.lang.String
getDataConfigFilename(AVList params, java.lang.String suffix)
Returns a file store path name for the specified parameters list.static java.lang.String
getDataConfigType(org.w3c.dom.Element domElement)
Returns the specified data configuration document's type as a string, or null if the document is not one of the recognized types.protected static LatLon
getDataDescriptorLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
protected static Sector
getDataDescriptorSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
protected static java.lang.String
getInactiveLevels(LevelSet levelSet)
static AVList
getLevelSetConfigParams(LevelSet levelSet, AVList params)
Gathers LevelSet configuration parameters from a specified LevelSet reference.static AVList
getLevelSetConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses LevelSet configuration parameters from the specified DOM document.protected static int
getNumEmptyLevels(LevelSet levelSet)
static java.net.URL
getOGCGetCapabilitiesURL(AVList params)
Convenience method to get the OGC GetCapabilities URL from a specified parameter list.static java.lang.String[]
getOGCLayerNames(AVList params)
Convenience method to get the OGCAVKey.LAYER_NAMES
parameter from a specified parameter list.static AVList
getWCSConfigParameters(WCS100Capabilities caps, WCS100DescribeCoverage coverage, AVList params)
static AVList
getWCSConfigParams(org.w3c.dom.Element domElement, AVList params)
static AVList
getWMSLayerConfigParams(WMSCapabilities caps, java.lang.String[] formatOrderPreference, AVList params)
static AVList
getWMSLayerConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses WMS layer parameters from the XML configuration document starting at domElement.static AVList
getWWDotNetLayerSetConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses WorldWind .NET LayerSet configuration parameters from the specified document.protected static LatLon
getWWDotNetLayerSetLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
protected static Sector
getWWDotNetLayerSetSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
static boolean
hasDataConfigFile(FileStore fileStore, java.lang.String fileName, boolean removeIfExpired, long expiryTime)
Returns true if a configuration file name exists in the store which has not expired.static boolean
isDataConfig(org.w3c.dom.Element domElement)
Returns true if the specifiedElement
is a data configuration document.static boolean
isInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
Returns true if a specified DOM document is a DataDescriptor configuration document, and false otherwise.static boolean
isWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
Returns true if a specified document is a WorldWind .NET LayerSet configuration document, and false otherwise.static boolean
isWWDotNetLayerSetConfigEvent(javax.xml.stream.events.XMLEvent event)
Returns true if a specified XML event is the root of a WorldWind .NET LayerSet configuration document, and false otherwise.protected static java.lang.String
makeTitle(WMSCapabilities caps, java.lang.String layerNames, java.lang.String styleNames)
protected static void
transformDataDescriptorCommonElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
protected static void
transformDataDescriptorDataSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)
protected static void
transformDataDescriptorElevationModelElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
protected static void
transformDataDescriptorLayerElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
static org.w3c.dom.Document
transformInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
Transforms a DataDescriptor configuration document to a standard layer or elevation model configuration document, depending on the contents of theElement
.protected static void
transformWWDotNetLayerSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)
static org.w3c.dom.Document
transformWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
Transforms a WorldWind .NET LayerSet configuration document to a standard layer configuration document.protected static void
transformWWDotNetQuadTileSet(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
-
-
-
Field Detail
-
DATE_TIME_PATTERN
protected static final java.lang.String DATE_TIME_PATTERN
- See Also:
- Constant Field Values
-
DEFAULT_TEXTURE_FORMAT
protected static final java.lang.String DEFAULT_TEXTURE_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDataConfig
public static boolean isDataConfig(org.w3c.dom.Element domElement)
Returns true if the specifiedElement
is a data configuration document. This recognizes the following data configuration documents:- Layer Configuration Documents
- Elevation Model Configuration Documents
- Installed DataDescriptor Documents
- WorldWind .NET LayerSet Documents
- Parameters:
domElement
- the document in question.- Returns:
- true if the document is a data configuration document; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
convertToStandardDataConfigDocument
public static org.w3c.dom.Document convertToStandardDataConfigDocument(org.w3c.dom.Document doc)
Returns the specified data configuration document transformed to a standard Layer or ElevationModel configuration document. This returns the original document if the document is already in a standard form, or if the document is not one of the recognized types. Installed DataDescriptor documents are transformed to standard Layer or ElevationModel configuration documents, depending on the document contents. WorldWind .NET LayerSet documents are transformed to standard Layer configuration documents. This returns null if the document's root element is null.- Parameters:
doc
- the document to transform.- Returns:
- the specified document transformed to a standard data configuration document, the original document if it's already in a standard form or is unrecognized, or null if the document's root element is null.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getDataConfigDisplayName
public static java.lang.String getDataConfigDisplayName(org.w3c.dom.Element domElement)
Returns the specified data configuration document's display name as a string, or null if the document is not one of the recognized types. This determines the display name for each type of data configuration document as follows:Mapping Document Type Path to Display Name Layer Configuration ./DisplayName Elevation Model Configuration ./DisplayName Installed DataDescriptor ./property[@name="dataSet"]/property[@name="gov.nasa.worldwind.avkey.DatasetNameKey"] WorldWind .NET LayerSet ./QuadTileSet/Name Other null - Parameters:
domElement
- the data configuration document who's display name is returned.- Returns:
- a String representing the data configuration document's display name, or null if the document is not recognized.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getDataConfigType
public static java.lang.String getDataConfigType(org.w3c.dom.Element domElement)
Returns the specified data configuration document's type as a string, or null if the document is not one of the recognized types. This maps data configuration documents to a type string as follows:Mapping Document Type Type String Layer Configuration "Layer" Elevation Model Configuration "Elevation Model" Installed DataDescriptor "Layer" or "ElevationModel" WorldWind .NET LayerSet "Layer" Other null - Parameters:
domElement
- the data configuration document to determine a type for.- Returns:
- a String representing the data configuration document's type, or null if the document is not recognized.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getDataConfigFilename
public static java.lang.String getDataConfigFilename(AVList params, java.lang.String suffix)
Returns a file store path name for the specified parameters list. This returns null if the parameter list does not contain enough information to construct a path name.- Parameters:
params
- the parameter list to extract a configuration filename from.suffix
- the file suffix to append on the path name, or null to append no suffix.- Returns:
- a file store path name with the specified suffix, or null if a path name cannot be constructed.
- Throws:
java.lang.IllegalArgumentException
- if the parameter list is null.
-
getDataConfigCacheName
public static AVList getDataConfigCacheName(java.lang.String dataConfigCachePath, AVList params)
Convenience method for computing a data configuration file's cache name in a FileStore, given the file's cache path. This writes the computed cache name to the specified parameter list under the keyAVKey.DATA_CACHE_NAME
. If the parameter already exists, it's left unchanged.A data configuration file's cache name is its parent directory in the cache. The cache name therefore points to the directory containing both the configuration file and any cached data associated with it. Determining the cache name at run time - instead of hard wiring it in the data configuration file - enables cache data to be moved to an arbitrary location within the cache.
- Parameters:
dataConfigCachePath
- the data configuration file's cache path.params
- the output key-value pairs which receive the DATA_CACHE_NAME parameter. A null reference is permitted.- Returns:
- a reference to params, or a new AVList if params is null.
- Throws:
java.lang.IllegalArgumentException
- if the data config file's cache path is null or has length zero.
-
hasDataConfigFile
public static boolean hasDataConfigFile(FileStore fileStore, java.lang.String fileName, boolean removeIfExpired, long expiryTime)
Returns true if a configuration file name exists in the store which has not expired. This returns false if a configuration file does not exist, or it has expired. This invokesfindExistingDataConfigFile(gov.nasa.worldwind.cache.FileStore, String)
to determine the URL of any existing file names. If an existing file has expired, and removeIfExpired is true, this removes the existing file.- Parameters:
fileStore
- the file store in which to look.fileName
- the file name to look for. If a file with this name does not exist in the store, this looks at the file's siblings for a match.removeIfExpired
- true to remove the existing file, if it exists and is expired; false otherwise.expiryTime
- the time in milliseconds, before which a file is considered to be expired.- Returns:
- whether a configuration file already exists which has not expired.
- Throws:
java.lang.IllegalArgumentException
- if either the file store or file name are null.
-
findExistingDataConfigFile
public static java.net.URL findExistingDataConfigFile(FileStore fileStore, java.lang.String fileName)
Returns the URL of an existing data configuration file under the specified file store, or null if no configuration file exists. This first looks for a configuration file with the specified name. If that does not exist, this checks the siblings of the specified file for a configuration file match.- Parameters:
fileStore
- the file store in which to look.fileName
- the file name to look for. If a file with this name does not exist in the store, this looks at the file's siblings for a match.- Returns:
- the URL of an existing configuration file in the store, or null if none exists.
- Throws:
java.lang.IllegalArgumentException
- if either the file store or file name are null.
-
createResourceRetrievalService
public static java.util.concurrent.ScheduledExecutorService createResourceRetrievalService(java.lang.String threadName)
Convenience method to create aScheduledExecutorService
which can be used by World Wind components to schedule periodic resource checks. The returned ExecutorService is backed by a single daemon thread with minimum priority.- Parameters:
threadName
- the String name for the ExecutorService's thread, may benull
.- Returns:
- a new ScheduledExecutorService appropriate for scheduling periodic resource checks.
-
createWMSLayerConfigElements
public static org.w3c.dom.Element createWMSLayerConfigElements(AVList params, org.w3c.dom.Element context)
Appends WMS layer parameters as elements to a specified context. This appends elements for the following parameters:Mapping Parameter Element Path Type AVKey.WMS_VERSION
Service/@version String AVKey.LAYER_NAMES
Service/LayerNames String AVKey.STYLE_NAMES
Service/StyleNames String AVKey.GET_MAP_URL
Service/GetMapURL String AVKey.GET_CAPABILITIES_URL
Service/GetCapabilitiesURL String AVKey.SERVICE
AVKey#GET_MAP_URL String AVKey.DATASET_NAME
AVKey.LAYER_NAMES String - Parameters:
params
- the key-value pairs which define the WMS layer configuration parameters.context
- the XML document root on which to append WMS layer configuration elements.- Returns:
- a reference to context.
- Throws:
java.lang.IllegalArgumentException
- if either the parameters or the context are null.
-
createWCSLayerConfigElements
public static org.w3c.dom.Element createWCSLayerConfigElements(AVList params, org.w3c.dom.Element context)
Appends WCS layer parameters as elements to a specified context. This appends elements for the following parameters:Mapping Parameter Element Path Type AVKey.WCS_VERSION
Service/@version String AVKey.COVERAGE_IDENTIFIERS
Service/coverageIdentifiers String AVKey.GET_COVERAGE_URL
Service/GetCoverageURL String AVKey.GET_CAPABILITIES_URL
Service/GetCapabilitiesURL String AVKey.SERVICE
AVKey#GET_COVERAGE_URL String AVKey.DATASET_NAME
AVKey.COVERAGE_IDENTIFIERS String - Parameters:
params
- the key-value pairs which define the WMS layer configuration parameters.context
- the XML document root on which to append WMS layer configuration elements.- Returns:
- a reference to context.
- Throws:
java.lang.IllegalArgumentException
- if either the parameters or the context are null.
-
getWMSLayerConfigParams
public static AVList getWMSLayerConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses WMS layer parameters from the XML configuration document starting at domElement. This writes output as key-value pairs to params. If a parameter from the XML document already exists in params, that parameter is ignored. Supported key and parameter names are:Mapping Parameter Element Path Type AVKey.WMS_VERSION
Service/@version String AVKey.LAYER_NAMES
Service/LayerNames String AVKey.STYLE_NAMES
Service/StyleNames String AVKey.GET_MAP_URL
Service/GetMapURL String AVKey.GET_CAPABILITIES_URL
Service/GetCapabilitiesURL String AVKey.SERVICE
AVKey#GET_MAP_URL String AVKey.DATASET_NAME
AVKey.LAYER_NAMES String - Parameters:
domElement
- the XML document root to parse for WMS layer parameters.params
- the output key-value pairs which receive the WMS layer parameters. A null reference is permitted.- Returns:
- a reference to params, or a new AVList if params is null.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getWCSConfigParams
public static AVList getWCSConfigParams(org.w3c.dom.Element domElement, AVList params)
-
getWMSLayerConfigParams
public static AVList getWMSLayerConfigParams(WMSCapabilities caps, java.lang.String[] formatOrderPreference, AVList params)
-
getWCSConfigParameters
public static AVList getWCSConfigParameters(WCS100Capabilities caps, WCS100DescribeCoverage coverage, AVList params)
-
getOGCGetCapabilitiesURL
public static java.net.URL getOGCGetCapabilitiesURL(AVList params)
Convenience method to get the OGC GetCapabilities URL from a specified parameter list. If all the necessary parameters are available, this returns the GetCapabilities URL. Otherwise this returns null.- Parameters:
params
- parameter list to get the GetCapabilities parameters from.- Returns:
- a OGC GetCapabilities URL, or null if the necessary parameters are not available.
- Throws:
java.lang.IllegalArgumentException
- if the parameter list is null.
-
getOGCLayerNames
public static java.lang.String[] getOGCLayerNames(AVList params)
Convenience method to get the OGCAVKey.LAYER_NAMES
parameter from a specified parameter list. If the parameter is available as a String, this returns all the OGC layer names found in that String. Otherwise this returns null.- Parameters:
params
- parameter list to get the layer names from.- Returns:
- an array of layer names, or null if none exist.
- Throws:
java.lang.IllegalArgumentException
- if the parameter list is null.
-
chooseImageFormat
protected static java.lang.String chooseImageFormat(java.lang.Object[] formats, java.lang.String[] formatOrderPreference)
-
makeTitle
protected static java.lang.String makeTitle(WMSCapabilities caps, java.lang.String layerNames, java.lang.String styleNames)
-
createLevelSetConfigElements
public static org.w3c.dom.Element createLevelSetConfigElements(AVList params, org.w3c.dom.Element context)
Appends LevelSet configuration parameters as elements to the specified context. This appends elements for the following parameters:Mapping Key Name Path AVKey.DATASET_NAME
DatasetName String AVKey.DATA_CACHE_NAME
DataCacheName String AVKey.SERVICE
Service/URL String AVKey.EXPIRY_TIME
ExpiryTime Long AVKey.EXPIRY_TIME
LastUpdate Long AVKey.FORMAT_SUFFIX
FormatSuffix String AVKey.NUM_LEVELS
NumLevels/@count Integer AVKey.NUM_EMPTY_LEVELS
NumLevels/@numEmpty Integer AVKey.INACTIVE_LEVELS
NumLevels/@inactive String AVKey.SECTOR
Sector Sector
AVKey.SECTOR_RESOLUTION_LIMITS
SectorResolutionLimit LevelSet.SectorResolution
AVKey.TILE_ORIGIN
TileOrigin/LatLon LatLon
AVKey.TILE_WIDTH
TileSize/Dimension/@width Integer AVKey.TILE_HEIGHT
TileSize/Dimension/@height Integer AVKey.LEVEL_ZERO_TILE_DELTA
LastUpdate LatLon AVKey.MAX_ABSENT_TILE_ATTEMPTS
MaxAbsentTileAttempts Integer AVKey.MIN_ABSENT_TILE_CHECK_INTERVAL
MinAbsentTileCheckInterval Integer - Parameters:
params
- the key-value pairs which define the LevelSet configuration parameters.context
- the XML document root on which to append LevelSet configuration elements.- Returns:
- a reference to context.
- Throws:
java.lang.IllegalArgumentException
- if either the parameters or the context are null.
-
getLevelSetConfigParams
public static AVList getLevelSetConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses LevelSet configuration parameters from the specified DOM document. This writes output as key-value pairs to params. If a parameter from the XML document already exists in params, that parameter is ignored. Supported key and parameter names are:Mapping Parameter Element path Type AVKey.DATASET_NAME
DatasetName String AVKey.DATA_CACHE_NAME
DataCacheName String AVKey.SERVICE
Service/URL String AVKey.EXPIRY_TIME
ExpiryTime Long AVKey.EXPIRY_TIME
LastUpdate Long AVKey.FORMAT_SUFFIX
FormatSuffix String AVKey.NUM_LEVELS
NumLevels/@count Integer AVKey.NUM_EMPTY_LEVELS
NumLevels/@numEmpty Integer AVKey.INACTIVE_LEVELS
NumLevels/@inactive String AVKey.SECTOR
Sector Sector
AVKey.SECTOR_RESOLUTION_LIMITS
SectorResolutionLimit LevelSet.SectorResolution
AVKey.TILE_ORIGIN
TileOrigin/LatLon LatLon
AVKey.TILE_WIDTH
TileSize/Dimension/@width Integer AVKey.TILE_HEIGHT
TileSize/Dimension/@height Integer AVKey.LEVEL_ZERO_TILE_DELTA
LastUpdate LatLon AVKey.MAX_ABSENT_TILE_ATTEMPTS
AbsentTiles/MaxAttempts Integer AVKey.MIN_ABSENT_TILE_CHECK_INTERVAL
AbsentTiles/MinCheckInterval/Time Integer milliseconds - Parameters:
domElement
- the XML document root to parse for LevelSet configuration parameters.params
- the output key-value pairs which receive the LevelSet configuration parameters. A null reference is permitted.- Returns:
- a reference to params, or a new AVList if params is null.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getLevelSetConfigParams
public static AVList getLevelSetConfigParams(LevelSet levelSet, AVList params)
Gathers LevelSet configuration parameters from a specified LevelSet reference. This writes output as key-value pairs params. If a parameter from the XML document already exists in params, that parameter is ignored. Supported key and parameter names are:Mapping Parameter Element Path Type AVKey.DATASET_NAME
First Level's dataset String AVKey.DATA_CACHE_NAME
First Level's cacheName String AVKey.SERVICE
First Level's service String AVKey.EXPIRY_TIME
First Level's expiryTime Long AVKey.FORMAT_SUFFIX
FirstLevel's formatSuffix String AVKey.NUM_LEVELS
numLevels Integer AVKey.NUM_EMPTY_LEVELS
1 + index of first non-empty Level Integer AVKey.INACTIVE_LEVELS
Comma delimited string of Level numbers String AVKey.SECTOR
sector Sector
AVKey.SECTOR_RESOLUTION_LIMITS
sectorLevelLimits LevelSet.SectorResolution
AVKey.TILE_ORIGIN
tileOrigin LatLon
AVKey.TILE_WIDTH
First Level's tileWidth Integer AVKey.TILE_HEIGHT
First Level's tileHeight Integer AVKey.LEVEL_ZERO_TILE_DELTA
levelZeroTileDelta LatLon - Parameters:
levelSet
- the LevelSet reference to gather configuration parameters from.params
- the output key-value pairs which receive the LevelSet configuration parameters. A null reference is permitted.- Returns:
- a reference to params, or a new AVList if params is null.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
getNumEmptyLevels
protected static int getNumEmptyLevels(LevelSet levelSet)
-
getInactiveLevels
protected static java.lang.String getInactiveLevels(LevelSet levelSet)
-
isInstalledDataDescriptorConfigDocument
public static boolean isInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
Returns true if a specified DOM document is a DataDescriptor configuration document, and false otherwise.- Parameters:
domElement
- the DOM document in question.- Returns:
- true if the document is a DataDescriptor configuration document; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if document is null.
-
transformInstalledDataDescriptorConfigDocument
public static org.w3c.dom.Document transformInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
Transforms a DataDescriptor configuration document to a standard layer or elevation model configuration document, depending on the contents of theElement
.- Parameters:
domElement
- DataDescriptor document to transform.- Returns:
- standard Layer or ElevationModel document, or null if the DataDescriptor cannot be transformed to a standard document.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
transformDataDescriptorDataSet
protected static void transformDataDescriptorDataSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)
-
transformDataDescriptorCommonElements
protected static void transformDataDescriptorCommonElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
-
transformDataDescriptorElevationModelElements
protected static void transformDataDescriptorElevationModelElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
-
transformDataDescriptorLayerElements
protected static void transformDataDescriptorLayerElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
-
getDataDescriptorLatLon
protected static LatLon getDataDescriptorLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
-
getDataDescriptorSector
protected static Sector getDataDescriptorSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
-
isWWDotNetLayerSetConfigDocument
public static boolean isWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
Returns true if a specified document is a WorldWind .NET LayerSet configuration document, and false otherwise.- Parameters:
domElement
- the document in question.- Returns:
- true if the document is a LayerSet configuration document; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if document is null.
-
isWWDotNetLayerSetConfigEvent
public static boolean isWWDotNetLayerSetConfigEvent(javax.xml.stream.events.XMLEvent event)
Returns true if a specified XML event is the root of a WorldWind .NET LayerSet configuration document, and false otherwise.- Parameters:
event
- the XML event in question.- Returns:
- true if the event is a LayerSet configuration document element; false otherwise.
- Throws:
java.lang.IllegalArgumentException
- if the event is null.
-
getWWDotNetLayerSetConfigParams
public static AVList getWWDotNetLayerSetConfigParams(org.w3c.dom.Element domElement, AVList params)
Parses WorldWind .NET LayerSet configuration parameters from the specified document. This writes output as key-value pairs to params. If a parameter from the LayerSet document already exists in params, that parameter is ignored. Supported key and parameter names are:Mapping Parameter Element Path Type AVKey.DISPLAY_NAME
QuadTileSet/Name String AVKey.DATASET_NAME
QuadTileSet/Name String AVKey.OPACITY
QuadTileSet/Opacity Double AVKey.SERVICE_NAME
"Offline" (string constant) String AVKey.FORMAT_SUFFIX
QuadTileSet/ImageAccessor/ImageFileExtension String AVKey.IMAGE_FORMAT
QuadTileSet/ImageAccessor/ImageFileExtension (converted to mime type) String AVKey.AVAILABLE_IMAGE_FORMATS
QuadTileSet/ImageAccessor/ImageFileExtension (converted to mime type) String array AVKey.NUM_LEVELS
QuadTileSet/ImageAccessor/NumberLevels Integer AVKey.NUM_EMPTY_LEVELS
0 (integer constant) Integer AVKey.SECTOR
QuadTileSet/BoundingBox Sector AVKey.TILE_ORIGIN
(-90, -180) (geographic location constant) LatLon AVKey.LEVEL_ZERO_TILE_DELTA
QuadTileSet/ImageAccessor/LevelZeroTileSizeDegrees LatLon AVKey.TILE_WIDTH
QuadTileSet/ImageAccessor/TextureSizePixels Integer AVKey.TILE_HEIGHT
QuadTileSet/ImageAccessor/TextureSizePixels Integer AVKey.NETWORK_RETRIEVAL_ENABLED
false (boolean constant) Boolean AVKey.TEXTURE_FORMAT
"image/dds" String AVKey.USE_MIP_MAPS
true (boolean constant) Boolean AVKey.USE_TRANSPARENT_TEXTURES
true (boolean constant) Boolean - Parameters:
domElement
- the XML document root to parse for LayerSet configuration parameters.params
- the output key-value pairs which receive the LayerSet configuration parameters. A null reference is permitted.- Returns:
- a reference to params, or a new AVList if params is null.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
transformWWDotNetLayerSetConfigDocument
public static org.w3c.dom.Document transformWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
Transforms a WorldWind .NET LayerSet configuration document to a standard layer configuration document.- Parameters:
domElement
- LayerSet document to transform.- Returns:
- standard Layer document, or null if the LayerSet document cannot be transformed to a standard document.
- Throws:
java.lang.IllegalArgumentException
- if the document is null.
-
transformWWDotNetLayerSet
protected static void transformWWDotNetLayerSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)
-
transformWWDotNetQuadTileSet
protected static void transformWWDotNetQuadTileSet(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
-
getWWDotNetLayerSetLatLon
protected static LatLon getWWDotNetLayerSetLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
-
getWWDotNetLayerSetSector
protected static Sector getWWDotNetLayerSetSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
-
-