public interface ILcdModelHeightProviderFactory
// 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()
// ...
}
TLcdModelHeightProviderFactoryUtil
Modifier and Type | Field and Description |
---|---|
static String |
KEY_GEO_REFERENCE
Key used for an
ILcdGeoReference property. |
Modifier and Type | Method and Description |
---|---|
ILcdHeightProvider |
createHeightProvider(ILcdModel aModel,
Map<String,Object> aRequiredPropertiesSFCT,
Map<String,Object> aOptionalProperties)
Returns a height provider for a given
ILcdModel using the given
properties. |
static final String KEY_GEO_REFERENCE
ILcdGeoReference
property. This property determines the reference
in which the points passed to the created ILcdHeightProvider
should
be defined. The returned height is also expressed in function of this ILcdGeoReference
.
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 an ILcdGeoReference
.ILcdHeightProvider createHeightProvider(ILcdModel aModel, Map<String,Object> aRequiredPropertiesSFCT, Map<String,Object> aOptionalProperties) throws TLcdMissingPropertyException, TLcdUnsupportedPropertyException
ILcdModel
using the given
properties. The returned height provider is determined by the implementation,
the ILcdModel
and the given properties.aModel
- an ILcdModel
for which a height provider is created.aRequiredPropertiesSFCT
- the required properties. The properties can be retrieved using a
String
key describing the property type. When not all required properties
are used, an exception is thrown. aRequiredProperties
may be empty but should
not be null
. When an implementation of this interface uses a required
property, it should always remove it from the list of required properties. When the
ILcdHeightProvider
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 a
String
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.null
when elevation
is not supported or when no valid height provider can be created.TLcdMissingPropertyException
- when the implementation misses a necessary property.TLcdUnsupportedPropertyException
- when a required property is not used by the
implementation.TLcdModelHeightProviderFactoryUtil