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
Fields -
Method Summary
-
Field Details
-
KEY_GEO_REFERENCE
Key used for anILcdGeoReferenceproperty. This property determines the reference in which the points passed to the createdILcdHeightProvidershould 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 givenILcdModelusing the given properties. The returned height provider is determined by the implementation, theILcdModeland the given properties.- Parameters:
aModel- anILcdModelfor which a height provider is created.aRequiredPropertiesSFCT- the required properties. The properties can be retrieved using aStringkey describing the property type. When not all required properties are used, an exception is thrown.aRequiredPropertiesmay 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 theILcdHeightProvideris 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 aStringkey describing the property type. The optional properties may or may not be used by the implementation.aOptionalPropertiesmay be empty but should not be null.- Returns:
- a height provider if elevation is supported, or
nullwhen 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:
-