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 ILcdPoint
s that are defined in this
reference. For example, if the reference is a TLcdGeodeticReference
, the points passed to
ILcdHeightProvider.retrieveHeightAt(ILcdPoint)
should be TLcdLonLatPoint
s.
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_DENSITY
Fields inherited from interface com.luciad.util.height.ILcdModelHeightProviderFactory
KEY_GEO_REFERENCE
-
Constructor Summary
ConstructorDescriptionConstructs a newTLcdRasterModelHeightProviderFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canCreateHeightProvider
(ILcdModel aModel) Check if a height provider can be created from the givenILcdModel
.protected ILcdHeightProvider
createModelElementHeightProvider
(Object aElement, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Creates anILcdHeightProvider
for the given model element.Methods inherited from class com.luciad.util.height.ALcdRasterModelHeightProviderFactory
transformProperties
Methods 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:ALcdModelHeightProviderFactory
Creates anILcdHeightProvider
for the given model element.- Specified by:
createModelElementHeightProvider
in classALcdRasterModelHeightProviderFactory
- Parameters:
aElement
- a model element.aRequiredPropertiesSFCT
- the required properties.aOptionalProperties
- the optional properties.- Returns:
- an
ILcdHeightProvider
for the given model element ornull
if noILcdHeightProvider
can 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:ALcdRasterModelHeightProviderFactory
Check if a height provider can be created from the givenILcdModel
. The default implementation only returnstrue
if the model contains aTLcdRasterModelDescriptor
or aTLcdMultilevelRasterModelDescriptor
, andfalse
otherwise.- Overrides:
canCreateHeightProvider
in classALcdRasterModelHeightProviderFactory
- Parameters:
aModel
- the given model.- Returns:
true
if a height provider can be created from the given model andfalse
otherwise.
-