Class TLcdRasterModelHeightProviderFactory
- All Implemented Interfaces:
ILcdModelHeightProviderFactory
Important notice: the package com.luciad.imaging presents a new API
for the modeling of raster data. For new projects, it is recommended to use
this API instead of ILcdRaster et al.
ILcdHeightProvider when an
ILcdModel is given that only contains elements of the type
ILcdRaster or ILcdMultilevelRaster.
Sample code
A class that requires a height provider based on a raster model could construct one as follows:
// Create a height provider factory.
ILcdModelHeightProviderFactory factory = new TLcdRasterModelHeightProviderFactory();
// Specify the desired properties for the height provider.
Map<String, Object> requiredProperties = new HashMap<String, Object>();
requiredProperties.put(ALcdModelHeightProviderFactory.KEY_GEO_REFERENCE, aModelReference);
Map<String, Object> optionalProperties = new HashMap<String, Object>();
optionalProperties.put(TLcdRasterModelHeightProviderFactory.KEY_PIXEL_DENSITY, 2.5);
// Create a height provider from a raster model.
ILcdHeightProvider heightProvider =
factory.createHeightProvider(aModel, requiredProperties, optionalProperties);
For many cases it is sufficient to add the ILcdModelHeightProviderFactory.KEY_GEO_REFERENCE
property. Not setting this property will generate an exception in most cases. When using a
ILcdHeightProvider constructed with a specific ILcdGeoReference as
required property, one can retrieve height using ILcdPoints that are defined in this
reference. For example, if the reference is a TLcdGeodeticReference, the points passed to
ILcdHeightProvider.retrieveHeightAt(ILcdPoint) should be TLcdLonLatPoints.
If the reference is a TLcdGridReference, the points passed to it should be
TLcdXYPoints.
An other property that can be passed is for example ALcdRasterModelHeightProviderFactory.KEY_PIXEL_DENSITY. This property
determines which raster is chosen from a multi level raster based on a pixel density. In most
cases, this property should be passed as an optional property since not all height providers
factories can interpret it.
- Since:
- 9.1
-
Field Summary
Fields inherited from class com.luciad.util.height.ALcdRasterModelHeightProviderFactory
KEY_INTERPOLATE_DATA, KEY_MAX_VALID_HEIGHT, KEY_MIN_VALID_HEIGHT, KEY_PIXEL_DENSITYFields inherited from interface com.luciad.util.height.ILcdModelHeightProviderFactory
KEY_GEO_REFERENCE -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newTLcdRasterModelHeightProviderFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanCreateHeightProvider(ILcdModel aModel) Check if a height provider can be created from the givenILcdModel.protected ILcdHeightProvidercreateModelElementHeightProvider(Object aElement, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Creates anILcdHeightProviderfor the given model element.Methods inherited from class com.luciad.util.height.ALcdRasterModelHeightProviderFactory
transformPropertiesMethods inherited from class com.luciad.util.height.ALcdModelHeightProviderFactory
createHeightProvider
-
Constructor Details
-
TLcdRasterModelHeightProviderFactory
public TLcdRasterModelHeightProviderFactory()Constructs a newTLcdRasterModelHeightProviderFactory.
-
-
Method Details
-
createModelElementHeightProvider
protected ILcdHeightProvider createModelElementHeightProvider(Object aElement, Map<String, Object> aRequiredPropertiesSFCT, Map<String, throws TLcdMissingPropertyException, TLcdUnsupportedPropertyExceptionObject> aOptionalProperties) Description copied from class:ALcdModelHeightProviderFactoryCreates anILcdHeightProviderfor the given model element.- Specified by:
createModelElementHeightProviderin classALcdRasterModelHeightProviderFactory- Parameters:
aElement- a model element.aRequiredPropertiesSFCT- the required properties.aOptionalProperties- the optional properties.- Returns:
- an
ILcdHeightProviderfor the given model element ornullif noILcdHeightProvidercan be created. - Throws:
TLcdMissingPropertyException- when a property is missing that is necessary to create theILcdHeightProvider.TLcdUnsupportedPropertyException- when a required property was never used while creating theILcdHeightProvider.
-
canCreateHeightProvider
Description copied from class:ALcdRasterModelHeightProviderFactoryCheck if a height provider can be created from the givenILcdModel. The default implementation only returnstrueif the model contains aTLcdRasterModelDescriptoror aTLcdMultilevelRasterModelDescriptor, andfalseotherwise.- Overrides:
canCreateHeightProviderin classALcdRasterModelHeightProviderFactory- Parameters:
aModel- the given model.- Returns:
trueif a height provider can be created from the given model andfalseotherwise.
-