Package com.luciad.util.height
Interface ILcdModelHeightProviderFactory
- All Known Implementing Classes:
ALcdModelHeightProviderFactory
,ALcdRasterModelHeightProviderFactory
,TLcdCompositeModelHeightProviderFactory
,TLcdEarthHeightProviderFactory
,TLcdImageModelHeightProviderFactory
,TLcdRasterModelHeightProviderFactory
,TLcyCompositeModelHeightProviderFactory
public interface ILcdModelHeightProviderFactory
This interface provides a method to create a height provider from a model.
Sample Code
// Create a height provider factory.
ILcdModelHeightProviderFactory factory = new TLcdRasterModelHeightProviderFactory();
try {
// Specify the desired properties for the height provider.
Map<String, Object> requiredProperties = new HashMap<>();
ILcdGeoReference geoReference = new TLcdGeodeticReference();
requiredProperties.put(ALcdModelHeightProviderFactory.KEY_GEO_REFERENCE, geoReference);
Map<String, Object> optionalProperties = new HashMap<>();
optionalProperties.put(TLcdRasterModelHeightProviderFactory.KEY_INTERPOLATE_DATA, true);
// Create a height provider from a raster model.
ILcdHeightProvider heightProvider =
factory.createHeightProvider(aModel, requiredProperties, optionalProperties);
// Retrieve height values.
double height = heightProvider.retrieveHeightAt(new TLcdLonLatPoint(10.0, 20.0));
} catch (TLcdMissingPropertyException ex) {
// A necessary property is missing : see ex.getMissingPropertyName()
// ...
} catch (TLcdUnsupportedPropertyException ex) {
// A required property was not used during the creation of the height provider :
// see ex.getUnsupportedProperties()
// ...
}
- Since:
- 9.1
- See Also:
-
Field Summary
-
Method Summary
-
Field Details
-
KEY_GEO_REFERENCE
Key used for anILcdGeoReference
property. This property determines the reference in which the points passed to the createdILcdHeightProvider
should be defined. The returned height is also expressed in function of thisILcdGeoReference
. Since this property defines the reference of the input and output of the created height provider, and is thus always needed, it should always be passed to the model height provider factory as a required property. The property should be anILcdGeoReference
.- See Also:
-
-
Method Details
-
createHeightProvider
ILcdHeightProvider createHeightProvider(ILcdModel aModel, Map<String, Object> aRequiredPropertiesSFCT, Map<String, throws TLcdMissingPropertyException, TLcdUnsupportedPropertyExceptionObject> aOptionalProperties) Returns a height provider for a givenILcdModel
using the given properties. The returned height provider is determined by the implementation, theILcdModel
and the given properties.- Parameters:
aModel
- anILcdModel
for which a height provider is created.aRequiredPropertiesSFCT
- the required properties. The properties can be retrieved using aString
key describing the property type. When not all required properties are used, an exception is thrown.aRequiredProperties
may be empty but should not benull
. When an implementation of this interface uses a required property, it should always remove it from the list of required properties. When theILcdHeightProvider
is actually made, implementations should verify that the list of required properties is empty (and all required properties are used).aOptionalProperties
- the optional properties. The properties can be retrieved using aString
key describing the property type. The optional properties may or may not be used by the implementation.aOptionalProperties
may be empty but should not be null.- Returns:
- a height provider if elevation is supported, or
null
when elevation is not supported or when no valid height provider can be created. - Throws:
TLcdMissingPropertyException
- when the implementation misses a necessary property.TLcdUnsupportedPropertyException
- when a required property is not used by the implementation.- See Also:
-