Package gov.nasa.worldwind.terrain
Class BasicElevationModelFactory
- java.lang.Object
-
- gov.nasa.worldwind.BasicFactory
-
- gov.nasa.worldwind.terrain.BasicElevationModelFactory
-
- All Implemented Interfaces:
Factory
public class BasicElevationModelFactory extends BasicFactory
A factory to createElevationModel
s.
-
-
Constructor Summary
Constructors Constructor Description BasicElevationModelFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CompoundElevationModel
createCompoundModel(org.w3c.dom.Element[] elements, AVList params)
Creates a compound elevation model and populates it with a specified list of elevation models.java.lang.Object
createFromConfigSource(java.lang.Object configSource, AVList params)
Creates an elevation model from a general configuration source.protected ElevationModel
createNonCompoundModel(org.w3c.dom.Element domElement, AVList params)
Create a simple elevation model.protected ElevationModel
doCreateFromCapabilities(OGCCapabilities caps, AVList params)
Implemented by subclasses to perform the actual object creation.protected java.lang.Object
doCreateFromCapabilities(WCS100Capabilities caps, AVList params)
Implemented by subclasses to perform the actual object creation.protected ElevationModel
doCreateFromElement(org.w3c.dom.Element domElement, AVList params)
Creates an elevation model from an XML description.-
Methods inherited from class gov.nasa.worldwind.BasicFactory
create, create, createFromCapabilities
-
-
-
-
Method Detail
-
createFromConfigSource
public java.lang.Object createFromConfigSource(java.lang.Object configSource, AVList params)
Creates an elevation model from a general configuration source. The source can be one of the following:- a
URL
- a
File
- a
InputStream
- an
Element
- a
String
holding a file name, a name of a resource on the classpath, or a string representation of a URL
For non-compound models, this method maps the
serviceName
attribute of theElevationModel/Service
element of the XML configuration document to the appropriate elevation-model type. Service types recognized are:"- "WMS" for elevation models that draw their data from a WMS web service.
- "WWTileService" for elevation models that draw their data from a WorldWind tile service.
- "Offline" for elevation models that draw their data only from the local cache.
- Specified by:
createFromConfigSource
in interfaceFactory
- Overrides:
createFromConfigSource
in classBasicFactory
- Parameters:
configSource
- the configuration source. See above for supported types.params
- properties to associate with the elevation model during creation.- Returns:
- an elevation model.
- Throws:
java.lang.IllegalArgumentException
- if the configuration file name is null or an empty string.WWUnrecognizedException
- if the source type is unrecognized or the requested elevation-model type is unrecognized.WWRuntimeException
- if object creation fails for other reasons. The exception identifying the source of the failure is included as theThrowable.initCause(Throwable)
.
- a
-
doCreateFromCapabilities
protected ElevationModel doCreateFromCapabilities(OGCCapabilities caps, AVList params)
Description copied from class:BasicFactory
Implemented by subclasses to perform the actual object creation. This default implementation always returns null.- Overrides:
doCreateFromCapabilities
in classBasicFactory
- Parameters:
caps
- the capabilities document.params
- a list of configuration properties. These properties override any specified in the capabilities document. The list should contain theAVKey.LAYER_NAMES
property for services that define layers, indicating which named layers described in the capabilities document to create. If this argumet is null or contains no layers, the first named layer is used.- Returns:
- the requested object.
-
doCreateFromCapabilities
protected java.lang.Object doCreateFromCapabilities(WCS100Capabilities caps, AVList params)
Description copied from class:BasicFactory
Implemented by subclasses to perform the actual object creation. This default implementation always returns null.- Overrides:
doCreateFromCapabilities
in classBasicFactory
- Parameters:
caps
- the capabilities document.params
- a list of configuration properties. These properties override any specified in the capabilities document.- Returns:
- the requested object.
-
doCreateFromElement
protected ElevationModel doCreateFromElement(org.w3c.dom.Element domElement, AVList params) throws java.lang.Exception
Creates an elevation model from an XML description. An "href" link to an external elevation model description is followed if it exists.- Overrides:
doCreateFromElement
in classBasicFactory
- Parameters:
domElement
- an XML element containing the elevation model description.params
- any parameters to apply when creating the elevation models.- Returns:
- the requested elevation model, or null if the specified element does not describe an elevation model.
- Throws:
java.lang.Exception
- if a problem occurs during creation.- See Also:
createNonCompoundModel(org.w3c.dom.Element, gov.nasa.worldwind.avlist.AVList)
-
createCompoundModel
protected CompoundElevationModel createCompoundModel(org.w3c.dom.Element[] elements, AVList params)
Creates a compound elevation model and populates it with a specified list of elevation models.Any exceptions occurring during creation of the elevation models are logged and not re-thrown. The elevation models associated with the exceptions are not included in the returned compound model.
- Parameters:
elements
- the XML elements describing the models in the new elevation model.params
- any parameters to apply when creating the elevation models.- Returns:
- a compound elevation model populated with the specified elevation models. The compound model will contain no elevation models if none were specified or exceptions occurred for all that were specified.
- See Also:
createNonCompoundModel(org.w3c.dom.Element, gov.nasa.worldwind.avlist.AVList)
-
createNonCompoundModel
protected ElevationModel createNonCompoundModel(org.w3c.dom.Element domElement, AVList params)
Create a simple elevation model.- Parameters:
domElement
- the XML element describing the elevation model to create. The element must inculde a service name identifying the type of service to use to retrieve elevation data. Recognized service types are "Offline", "WWTileService" and "OGC:WMS".params
- any parameters to apply when creating the elevation model.- Returns:
- a new elevation model
- Throws:
WWUnrecognizedException
- if the service type given in the describing element is unrecognized.
-
-