Package gov.nasa.worldwind.util
Class DataConfigurationUtils
- java.lang.Object
-
- gov.nasa.worldwind.util.DataConfigurationUtils
-
public class DataConfigurationUtils extends java.lang.ObjectA 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.StringDATE_TIME_PATTERNprotected static java.lang.StringDEFAULT_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.StringchooseImageFormat(java.lang.Object[] formats, java.lang.String[] formatOrderPreference)static org.w3c.dom.DocumentconvertToStandardDataConfigDocument(org.w3c.dom.Document doc)Returns the specified data configuration document transformed to a standard Layer or ElevationModel configuration document.static org.w3c.dom.ElementcreateLevelSetConfigElements(AVList params, org.w3c.dom.Element context)Appends LevelSet configuration parameters as elements to the specified context.static java.util.concurrent.ScheduledExecutorServicecreateResourceRetrievalService(java.lang.String threadName)Convenience method to create aScheduledExecutorServicewhich can be used by World Wind components to schedule periodic resource checks.static org.w3c.dom.ElementcreateWCSLayerConfigElements(AVList params, org.w3c.dom.Element context)Appends WCS layer parameters as elements to a specified context.static org.w3c.dom.ElementcreateWMSLayerConfigElements(AVList params, org.w3c.dom.Element context)Appends WMS layer parameters as elements to a specified context.static java.net.URLfindExistingDataConfigFile(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 AVListgetDataConfigCacheName(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.StringgetDataConfigDisplayName(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.StringgetDataConfigFilename(AVList params, java.lang.String suffix)Returns a file store path name for the specified parameters list.static java.lang.StringgetDataConfigType(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 LatLongetDataDescriptorLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)protected static SectorgetDataDescriptorSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)protected static java.lang.StringgetInactiveLevels(LevelSet levelSet)static AVListgetLevelSetConfigParams(LevelSet levelSet, AVList params)Gathers LevelSet configuration parameters from a specified LevelSet reference.static AVListgetLevelSetConfigParams(org.w3c.dom.Element domElement, AVList params)Parses LevelSet configuration parameters from the specified DOM document.protected static intgetNumEmptyLevels(LevelSet levelSet)static java.net.URLgetOGCGetCapabilitiesURL(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_NAMESparameter from a specified parameter list.static AVListgetWCSConfigParameters(WCS100Capabilities caps, WCS100DescribeCoverage coverage, AVList params)static AVListgetWCSConfigParams(org.w3c.dom.Element domElement, AVList params)static AVListgetWMSLayerConfigParams(WMSCapabilities caps, java.lang.String[] formatOrderPreference, AVList params)static AVListgetWMSLayerConfigParams(org.w3c.dom.Element domElement, AVList params)Parses WMS layer parameters from the XML configuration document starting at domElement.static AVListgetWWDotNetLayerSetConfigParams(org.w3c.dom.Element domElement, AVList params)Parses WorldWind .NET LayerSet configuration parameters from the specified document.protected static LatLongetWWDotNetLayerSetLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)protected static SectorgetWWDotNetLayerSetSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)static booleanhasDataConfigFile(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 booleanisDataConfig(org.w3c.dom.Element domElement)Returns true if the specifiedElementis a data configuration document.static booleanisInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)Returns true if a specified DOM document is a DataDescriptor configuration document, and false otherwise.static booleanisWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)Returns true if a specified document is a WorldWind .NET LayerSet configuration document, and false otherwise.static booleanisWWDotNetLayerSetConfigEvent(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.StringmakeTitle(WMSCapabilities caps, java.lang.String layerNames, java.lang.String styleNames)protected static voidtransformDataDescriptorCommonElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)protected static voidtransformDataDescriptorDataSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)protected static voidtransformDataDescriptorElevationModelElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)protected static voidtransformDataDescriptorLayerElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)static org.w3c.dom.DocumenttransformInstalledDataDescriptorConfigDocument(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 voidtransformWWDotNetLayerSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)static org.w3c.dom.DocumenttransformWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)Transforms a WorldWind .NET LayerSet configuration document to a standard layer configuration document.protected static voidtransformWWDotNetQuadTileSet(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 specifiedElementis 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 aScheduledExecutorServicewhich 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_VERSIONService/@version String AVKey.LAYER_NAMESService/LayerNames String AVKey.STYLE_NAMESService/StyleNames String AVKey.GET_MAP_URLService/GetMapURL String AVKey.GET_CAPABILITIES_URLService/GetCapabilitiesURL String AVKey.SERVICEAVKey#GET_MAP_URL String AVKey.DATASET_NAMEAVKey.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_VERSIONService/@version String AVKey.COVERAGE_IDENTIFIERSService/coverageIdentifiers String AVKey.GET_COVERAGE_URLService/GetCoverageURL String AVKey.GET_CAPABILITIES_URLService/GetCapabilitiesURL String AVKey.SERVICEAVKey#GET_COVERAGE_URL String AVKey.DATASET_NAMEAVKey.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_VERSIONService/@version String AVKey.LAYER_NAMESService/LayerNames String AVKey.STYLE_NAMESService/StyleNames String AVKey.GET_MAP_URLService/GetMapURL String AVKey.GET_CAPABILITIES_URLService/GetCapabilitiesURL String AVKey.SERVICEAVKey#GET_MAP_URL String AVKey.DATASET_NAMEAVKey.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_NAMESparameter 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_NAMEDatasetName String AVKey.DATA_CACHE_NAMEDataCacheName String AVKey.SERVICEService/URL String AVKey.EXPIRY_TIMEExpiryTime Long AVKey.EXPIRY_TIMELastUpdate Long AVKey.FORMAT_SUFFIXFormatSuffix String AVKey.NUM_LEVELSNumLevels/@count Integer AVKey.NUM_EMPTY_LEVELSNumLevels/@numEmpty Integer AVKey.INACTIVE_LEVELSNumLevels/@inactive String AVKey.SECTORSector SectorAVKey.SECTOR_RESOLUTION_LIMITSSectorResolutionLimit LevelSet.SectorResolutionAVKey.TILE_ORIGINTileOrigin/LatLon LatLonAVKey.TILE_WIDTHTileSize/Dimension/@width Integer AVKey.TILE_HEIGHTTileSize/Dimension/@height Integer AVKey.LEVEL_ZERO_TILE_DELTALastUpdate LatLon AVKey.MAX_ABSENT_TILE_ATTEMPTSMaxAbsentTileAttempts Integer AVKey.MIN_ABSENT_TILE_CHECK_INTERVALMinAbsentTileCheckInterval 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_NAMEDatasetName String AVKey.DATA_CACHE_NAMEDataCacheName String AVKey.SERVICEService/URL String AVKey.EXPIRY_TIMEExpiryTime Long AVKey.EXPIRY_TIMELastUpdate Long AVKey.FORMAT_SUFFIXFormatSuffix String AVKey.NUM_LEVELSNumLevels/@count Integer AVKey.NUM_EMPTY_LEVELSNumLevels/@numEmpty Integer AVKey.INACTIVE_LEVELSNumLevels/@inactive String AVKey.SECTORSector SectorAVKey.SECTOR_RESOLUTION_LIMITSSectorResolutionLimit LevelSet.SectorResolutionAVKey.TILE_ORIGINTileOrigin/LatLon LatLonAVKey.TILE_WIDTHTileSize/Dimension/@width Integer AVKey.TILE_HEIGHTTileSize/Dimension/@height Integer AVKey.LEVEL_ZERO_TILE_DELTALastUpdate LatLon AVKey.MAX_ABSENT_TILE_ATTEMPTSAbsentTiles/MaxAttempts Integer AVKey.MIN_ABSENT_TILE_CHECK_INTERVALAbsentTiles/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_NAMEFirst Level's dataset String AVKey.DATA_CACHE_NAMEFirst Level's cacheName String AVKey.SERVICEFirst Level's service String AVKey.EXPIRY_TIMEFirst Level's expiryTime Long AVKey.FORMAT_SUFFIXFirstLevel's formatSuffix String AVKey.NUM_LEVELSnumLevels Integer AVKey.NUM_EMPTY_LEVELS1 + index of first non-empty Level Integer AVKey.INACTIVE_LEVELSComma delimited string of Level numbers String AVKey.SECTORsector SectorAVKey.SECTOR_RESOLUTION_LIMITSsectorLevelLimits LevelSet.SectorResolutionAVKey.TILE_ORIGINtileOrigin LatLonAVKey.TILE_WIDTHFirst Level's tileWidth Integer AVKey.TILE_HEIGHTFirst Level's tileHeight Integer AVKey.LEVEL_ZERO_TILE_DELTAlevelZeroTileDelta 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_NAMEQuadTileSet/Name String AVKey.DATASET_NAMEQuadTileSet/Name String AVKey.OPACITYQuadTileSet/Opacity Double AVKey.SERVICE_NAME"Offline" (string constant) String AVKey.FORMAT_SUFFIXQuadTileSet/ImageAccessor/ImageFileExtension String AVKey.IMAGE_FORMATQuadTileSet/ImageAccessor/ImageFileExtension (converted to mime type) String AVKey.AVAILABLE_IMAGE_FORMATSQuadTileSet/ImageAccessor/ImageFileExtension (converted to mime type) String array AVKey.NUM_LEVELSQuadTileSet/ImageAccessor/NumberLevels Integer AVKey.NUM_EMPTY_LEVELS0 (integer constant) Integer AVKey.SECTORQuadTileSet/BoundingBox Sector AVKey.TILE_ORIGIN(-90, -180) (geographic location constant) LatLon AVKey.LEVEL_ZERO_TILE_DELTAQuadTileSet/ImageAccessor/LevelZeroTileSizeDegrees LatLon AVKey.TILE_WIDTHQuadTileSet/ImageAccessor/TextureSizePixels Integer AVKey.TILE_HEIGHTQuadTileSet/ImageAccessor/TextureSizePixels Integer AVKey.NETWORK_RETRIEVAL_ENABLEDfalse (boolean constant) Boolean AVKey.TEXTURE_FORMAT"image/dds" String AVKey.USE_MIP_MAPStrue (boolean constant) Boolean AVKey.USE_TRANSPARENT_TEXTUREStrue (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)
-
-